mirror of
https://github.com/fosrl/pangolin.git
synced 2025-12-14 20:16:38 +00:00
15 lines
393 B
TypeScript
15 lines
393 B
TypeScript
import { rateLimitService } from "#private/lib/rateLimit";
|
|
import { cleanup as wsCleanup } from "#private/routers/ws";
|
|
|
|
async function cleanup() {
|
|
await rateLimitService.cleanup();
|
|
await wsCleanup();
|
|
|
|
process.exit(0);
|
|
}
|
|
|
|
export async function initCleanup() {
|
|
// Handle process termination
|
|
process.on("SIGTERM", () => cleanup());
|
|
process.on("SIGINT", () => cleanup());
|
|
} |