fixes: web interface shutdown
Local Docker Build (Dev) / build-dev (push) Successful in 4s

This commit is contained in:
2025-10-20 08:30:55 -04:00
parent eb9bfbf82e
commit 3c4e47b08e
5 changed files with 91 additions and 9 deletions
+8 -1
View File
@@ -6,6 +6,7 @@ Modular architecture with webhook processing and intelligent date handling
import os
import sys
import signal
import asyncio
from pathlib import Path
from datetime import datetime, timezone
@@ -34,6 +35,8 @@ from webhooks.webhook_batcher import WebhookBatcher
# Import API routes
from api.routes import register_routes
# Global shutdown event for graceful shutdown coordination
shutdown_event = asyncio.Event()
def get_version() -> str:
"""Get application version"""
@@ -107,7 +110,8 @@ def initialize_components():
"batcher": batcher,
"start_time": start_time,
"config": config,
"version": get_version()
"version": get_version(),
"shutdown_event": shutdown_event
}
@@ -115,6 +119,9 @@ def signal_handler(signum, frame):
"""Handle shutdown signals gracefully"""
_log("INFO", f"Received signal {signum}, shutting down gracefully...")
# Set shutdown event to notify background tasks
shutdown_event.set()
# Get the global dependencies if they exist
if hasattr(signal_handler, 'dependencies') and signal_handler.dependencies:
deps = signal_handler.dependencies