all repos — website @ 2038e626ef78f466d1d138cc3b48b6e522f4b0ed

My website

disable auto-sleep (fly will charge for stopped machines soon)

Alan Pearce
commit

2038e626ef78f466d1d138cc3b48b6e522f4b0ed

parent

f97814c2cdc8d34d5816afe7ed81c841ead84998

1 file changed, 0 insertions(+), 12 deletions(-)

changed files
M src/app.tssrc/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";
@@ -25,10 +24,6 @@ const defaultHeaders = {
...config.extra.headers, 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;
@@ -270,15 +265,8 @@ if (status === 200) {
const seconds = endTimer(); metrics.requestDuration.observe(seconds); } - if (autoSleep && pathname !== "/health") { - keepAwake(); - } } }, } satisfies Serve; - -if (autoSleep) { - keepAwake(); -} export default server;