fly: stop running in secondary regions if no meaningful requests
1 file changed, 8 insertions(+), 0 deletions(-)
changed files
A src/sleep.ts
@@ -0,0 +1,8 @@ +let sleepTimeout: Timer; + +export function keepAwake() { + if (sleepTimeout) clearTimeout(sleepTimeout); + sleepTimeout = setTimeout(function () { + process.exit(0); + }, 60_000); +}