Download packages/stats/server/src/shutdown.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 391 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/stats/server/src/shutdown.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/stats/server/src/shutdown.ts
-
curl -L -o shutdown.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/stats/server/src/shutdown.ts
391 Bytes
| let shuttingDown = false | |
| let signalHandlersRegistered = false | |
| export function isShuttingDown() { | |
| return shuttingDown | |
| } | |
| export function registerShutdownSignalHandlers() { | |
| if (signalHandlersRegistered) return | |
| signalHandlersRegistered = true | |
| process.once("SIGTERM", markShuttingDown) | |
| process.once("SIGINT", markShuttingDown) | |
| } | |
| function markShuttingDown() { | |
| shuttingDown = true | |
| } | |