mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user