SIENTIAPDE-1241: Simplify worker shutdown logic by removing conditional checks.

This commit is contained in:
Bruno Domingues
2025-10-30 15:14:43 -03:00
parent f5c1ac3615
commit bb25a19d8c

View File

@@ -152,10 +152,8 @@ async def main():
except BaseException as e: # noqa: BLE001
logger.custom_error(f'An unhandled exception occurred: {e}', metadata)
finally:
if notification_handler:
notification_handler.shutdown()
if activities:
await activities.shutdown()
notification_handler.shutdown()
await activities.shutdown()
# 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
sys.exit(1)