Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _throw_terminate(self):
logger.debug("Stop worker with RunTerminatedException")
raise RunTerminatedException()
def run(self):
try:
self.optimizer(self.strategy)
except RunTerminatedException:
logger.debug("Caught RunTerminatedException in opt thread")
finally:
self.strategy.terminate()