MCPcopy Index your code
hub / github.com/wei/pull / handleAppTermination

Function handleAppTermination

src/index.ts:56–67  ·  view source on GitHub ↗
(signal: string)

Source from the content-addressed store, hash-verified

54Deno.addSignalListener("SIGTERM", () => handleAppTermination("SIGTERM"));
55
56function handleAppTermination(signal: string) {
57 log.info(`[${signal}] Signal received: closing MongoDB connection`);
58 disconnectMongoDB();
59 try {
60 // Close Redis connection to avoid lingering connections
61 redisClient.quit();
62 } catch {
63 // ignore
64 }
65 log.info("[MongoDB] Connection closed due to app termination");
66 Deno.exit(0);
67}

Callers 1

index.tsFile · 0.85

Calls 1

disconnectMongoDBFunction · 0.90

Tested by

no test coverage detected