mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-07 04:47:08 +00:00
- SQLite: enable WAL mode and PRAGMA performance settings - ws.ts (public + private): fix clientConfigVersions memory leak - internal server: add rate limiting and request timeouts - audit log: fix flush re-queue feedback loop - memory: add monitoring instrumentation - security: remove debug log of full request body
24 lines
856 B
TypeScript
24 lines
856 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";
|
|
import { shutdownAuditLogger } from "@server/routers/badger/logRequestAudit";
|
|
|
|
async function cleanup() {
|
|
await stopPingAccumulator();
|
|
await shutdownAuditLogger();
|
|
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());
|
|
}
|