Spaces:
Paused
Paused
chore: increase keepalive frequency to every minute and add logging for health check requests
Browse filesFiles changed (2)
154 unmodified lines155156157158159160161154 unmodified lineswrite_keepalive_status({"configured": False, "status": "skipped", "message": "SPACE_HOST could not be determined."})returncron = os.environ.get("CLOUDFLARE_KEEPALIVE_CRON", "*/10 * * * *").strip()space_host = space_host.removeprefix("https://").removeprefix("http://").split("/")[0]target_url = os.environ.get("CLOUDFLARE_KEEPALIVE_URL", f"https://{space_host}/health").strip()worker_name = derive_keepalive_worker_name()154 unmodified lines155156157158159160161154 unmodified lineswrite_keepalive_status({"configured": False, "status": "skipped", "message": "SPACE_HOST could not be determined."})returncron = os.environ.get("CLOUDFLARE_KEEPALIVE_CRON", "* * * * *").strip()space_host = space_host.removeprefix("https://").removeprefix("http://").split("/")[0]target_url = os.environ.get("CLOUDFLARE_KEEPALIVE_URL", f"https://{space_host}/health").strip()worker_name = derive_keepalive_worker_name()
530 unmodified lines531532533534535536530 unmodified lines}if (path === "/health" || path === `${APP_BASE}/health`) {const data = await statusPayload();res.writeHead(data.ok ? 200 : 503, { "content-type": "application/json" });res.end(530 unmodified lines531532533534535536537538539530 unmodified lines}if (path === "/health" || path === `${APP_BASE}/health`) {if (req.headers["user-agent"] === "HuggingMess Cloudflare KeepAlive") {console.log(`[${new Date().toISOString()}] Received keepalive ping from Cloudflare.`);}const data = await statusPayload();res.writeHead(data.ok ? 200 : 503, { "content-type": "application/json" });res.end(
cloudflare-keepalive-setup.py+1-1
health-server.js+3