From 5a5d190decf5b442513470a91e4612ca218060e5 Mon Sep 17 00:00:00 2001 From: Noah AI Date: Thu, 2 Jul 2026 11:12:19 +0000 Subject: [PATCH] Add 10-second test health logger and /_cron/tick endpoint --- backend/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 3aceaa3..5e3aea0 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -18,18 +18,18 @@ const apiRoot = config.apiPrefix || '/'; app.use(apiRoot, createHealthRouter(config)); app.use(apiRoot, createTodosRouter(config, db)); - -// 10-second health check logger +// 1. Background 10-second health check logger setInterval(() => { console.log('[Health Check] Sandbox is healthy at ' + new Date().toISOString()); }, 10000); +// 2. Cloud Run Cron Tick endpoint (No-op to wake up event loop) app.post('/_cron/tick', (req, res) => { const authHeader = req.headers.authorization; if (!authHeader || authHeader !== 'Bearer ' + process.env.CRON_TOKEN) { return res.status(401).json({ success: false, error: 'Unauthorized' }); } - console.log('[Tick] Cloud Run cron tick triggered.'); + console.log('[Tick] Heartbeat received. Waking up event loop.'); res.status(200).json({ success: true }); });