MCPcopy Create free account
hub / github.com/dbunt1tled/python-fast-api / signal_handler

Method signal_handler

src/cmd/cli_command_base.py:63–67  ·  view source on GitHub ↗
(signum: int, frame: Any)

Source from the content-addressed store, hash-verified

61 main_task = None
62
63 def signal_handler(signum: int, frame: Any) -> None:
64 print(f"\n🛑 Received signal {signum}. Initiating graceful shutdown...")
65 if main_task and not main_task.done():
66 main_task.cancel()
67 shutdown_event.set()
68
69 signal.signal(signal.SIGINT, signal_handler)
70 signal.signal(signal.SIGTERM, signal_handler)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected