3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-18 15:00:00 +00:00
zeppelin/backend/src/threadsSignalFix.ts
Dragory b60a7fb145
fix: clinic.js 0kb output files
Something in our signal handlers/code that touched signal handlers
conflicted with clinic.js's signal handler code. With this commit,
we don't touch signal handlers at all if DEBUG mode is enabled.
2023-06-26 19:55:16 +00:00

13 lines
424 B
TypeScript

/**
* Hack for wiping out the threads signal handlers
* See: https://github.com/andywer/threads.js/issues/388
* Make sure:
* - This is imported before any real imports from "threads"
* - This is imported as early as possible to avoid removing our own signal handlers
*/
import "threads";
import { env } from "./env";
if (!env.DEBUG) {
process.removeAllListeners("SIGINT");
process.removeAllListeners("SIGTERM");
}