chg: Catch exceptions in the main loop
parent
595fa671d7
commit
76ec7ff379
|
@ -23,7 +23,10 @@ class AbstractManager(ABC):
|
||||||
while True:
|
while True:
|
||||||
if shutdown_requested():
|
if shutdown_requested():
|
||||||
break
|
break
|
||||||
|
try:
|
||||||
self._to_run_forever()
|
self._to_run_forever()
|
||||||
|
except Exception:
|
||||||
|
self.logger.exception('Something went terribly wrong in {}.'.format(self.__class__.__name__))
|
||||||
if not long_sleep(sleep_in_sec):
|
if not long_sleep(sleep_in_sec):
|
||||||
break
|
break
|
||||||
self.logger.info('Shutting down {}'.format(self.__class__.__name__))
|
self.logger.info('Shutting down {}'.format(self.__class__.__name__))
|
||||||
|
|
Loading…
Reference in New Issue