Fix Ctrl+C not stopping application gracefully

The signal handler was intercepting SIGINT but not exiting, causing
the application to continue running. Now re-raises KeyboardInterrupt
so Flask can handle shutdown properly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
James Smith
2025-12-30 22:55:04 +00:00
parent 0547086e4c
commit ddbed245e1

View File

@@ -86,8 +86,13 @@ atexit.register(cleanup_all_processes)
# Handle signals for graceful shutdown
def _signal_handler(signum, frame):
"""Handle termination signals."""
import sys
logger.info(f"Received signal {signum}, cleaning up...")
cleanup_all_processes()
# Re-raise KeyboardInterrupt for SIGINT so Flask can handle shutdown
if signum == signal.SIGINT:
raise KeyboardInterrupt()
sys.exit(0)
# Only register signal handlers if we're not in a thread