mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-06 01:31:06 +00:00
0655ba9423
Reverts diagnostic instrumentation and defensive hardening added during memory leak investigation. Only root cause fixes survive. Root causes fixed: - SQLite driver: auto-finalize wrapper + PRAGMAs - WS routers: delete clientConfigVersions on disconnect (unbounded Map leak) - WS private router: same + Redis key cleanup Reverted: - Memory monitor, rate limiting, request timeouts (diagnostic/hardening) - shutdownAuditLogger wiring, audit re-queue change, debug logs (cleanup/secondary) - package-lock.json drift
22 lines
745 B
TypeScript
22 lines
745 B
TypeScript
import { flushBandwidthToDb } from "@server/routers/newt/handleReceiveBandwidthMessage";
|
|
import { flushConnectionLogToDb } from "#dynamic/routers/newt";
|
|
import { flushSiteBandwidthToDb } from "@server/routers/gerbil/receiveBandwidth";
|
|
import { stopPingAccumulator } from "@server/routers/newt/pingAccumulator";
|
|
import { cleanup as wsCleanup } from "#dynamic/routers/ws";
|
|
|
|
async function cleanup() {
|
|
await stopPingAccumulator();
|
|
await flushBandwidthToDb();
|
|
await flushConnectionLogToDb();
|
|
await flushSiteBandwidthToDb();
|
|
await wsCleanup();
|
|
|
|
process.exit(0);
|
|
}
|
|
|
|
export async function initCleanup() {
|
|
// Handle process termination
|
|
process.on("SIGTERM", () => cleanup());
|
|
process.on("SIGINT", () => cleanup());
|
|
}
|