about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app.ts12
-rw-r--r--src/sleep.ts8
2 files changed, 0 insertions, 20 deletions
diff --git a/src/app.ts b/src/app.ts
index 6e714f9..a51e235 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -5,7 +5,6 @@ import type { BunFile, Serve } from "bun";
 import * as Sentry from "@sentry/node";
 import prom from "bun-prometheus-client";
 import log from "loglevel";
-import { keepAwake } from "./sleep.ts";
 
 import config from "./config";
 
@@ -26,10 +25,6 @@ const defaultHeaders = {
   vary: "Accept-Encoding",
 };
 
-const autoSleep =
-  import.meta.env.NODE_ENV === "production" &&
-  import.meta.env["FLY_REGION"] !== import.meta.env["PRIMARY_REGION"];
-
 type File = {
   filename: string;
   handle: BunFile;
@@ -270,15 +265,8 @@ export const server = {
         const seconds = endTimer();
         metrics.requestDuration.observe(seconds);
       }
-      if (autoSleep && pathname !== "/health") {
-        keepAwake();
-      }
     }
   },
 } satisfies Serve;
 
-if (autoSleep) {
-  keepAwake();
-}
-
 export default server;
diff --git a/src/sleep.ts b/src/sleep.ts
deleted file mode 100644
index 663d472..0000000
--- a/src/sleep.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-let sleepTimeout: Timer;
-
-export function keepAwake() {
-  if (sleepTimeout) clearTimeout(sleepTimeout);
-  sleepTimeout = setTimeout(function () {
-    process.exit(0);
-  }, 300_000);
-}