mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-23 00:41:36 +00:00
fix(mcp): call shutdownMetrics on serve graceful shutdown
The supported scrape target (gitnexus serve) was leaking the Prometheus exporter HTTP server on SIGINT/SIGTERM, leading to EADDRINUSE on restart. Mirror the existing pattern in mcp/server.ts.
This commit is contained in:
parent
2d0a4ffef2
commit
a101f0e3be
1 changed files with 4 additions and 0 deletions
|
|
@ -1832,6 +1832,10 @@ export const createServer = async (port: number, host: string = '127.0.0.1') =>
|
|||
await cleanupMcp();
|
||||
await closeLbug();
|
||||
await backend.disconnect();
|
||||
try {
|
||||
const { shutdownMetrics } = await import('../mcp/metrics.js');
|
||||
await shutdownMetrics();
|
||||
} catch {}
|
||||
const { flushLoggerSync } = await import('../core/logger.js');
|
||||
flushLoggerSync();
|
||||
process.exit(0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue