From 8ddbece991d9425bc0d66b3b262c1f693405519d Mon Sep 17 00:00:00 2001 From: James Smith Date: Tue, 30 Dec 2025 22:55:04 +0000 Subject: [PATCH] Fix Ctrl+C not stopping application gracefully MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- utils/process.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/process.py b/utils/process.py index dd4741c..202f370 100644 --- a/utils/process.py +++ b/utils/process.py @@ -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