pangolin/server/cleanup.ts
2025-10-10 11:27:15 -07:00

13 lines
No EOL
295 B
TypeScript

import { cleanup as wsCleanup } from "@server/routers/ws";
async function cleanup() {
await wsCleanup();
process.exit(0);
}
export async function initCleanup() {
// Handle process termination
process.on("SIGTERM", () => cleanup());
process.on("SIGINT", () => cleanup());
}