feat(gateway): add MCP server shutdown on gateway exit
Ensures MCP subprocess connections are closed when the messaging gateway shuts down, preventing orphan processes.
This commit is contained in:
parent
3c252ae44b
commit
0eb0bec74c
1 changed files with 8 additions and 1 deletions
|
|
@ -2202,7 +2202,14 @@ async def start_gateway(config: Optional[GatewayConfig] = None) -> bool:
|
|||
# Stop cron ticker cleanly
|
||||
cron_stop.set()
|
||||
cron_thread.join(timeout=5)
|
||||
|
||||
|
||||
# Close MCP server connections
|
||||
try:
|
||||
from tools.mcp_tool import shutdown_mcp_servers
|
||||
shutdown_mcp_servers()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue