SIENTIAPDE-1241: Simplify worker shutdown logic by removing conditional checks.
This commit is contained in:
@@ -152,10 +152,8 @@ async def main():
|
|||||||
except BaseException as e: # noqa: BLE001
|
except BaseException as e: # noqa: BLE001
|
||||||
logger.custom_error(f'An unhandled exception occurred: {e}', metadata)
|
logger.custom_error(f'An unhandled exception occurred: {e}', metadata)
|
||||||
finally:
|
finally:
|
||||||
if notification_handler:
|
notification_handler.shutdown()
|
||||||
notification_handler.shutdown()
|
await activities.shutdown()
|
||||||
if activities:
|
|
||||||
await activities.shutdown()
|
|
||||||
# Exit with a non-zero status code to indicate failure to Kubernetes
|
# Exit with a non-zero status code to indicate failure to Kubernetes
|
||||||
metrics.APP_UP.labels(pod_id=POD_ID).set(0) # Mark app as DOWN
|
metrics.APP_UP.labels(pod_id=POD_ID).set(0) # Mark app as DOWN
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user