Compare commits

...

3 Commits

Author SHA1 Message Date
groombook-cto[bot] fed390848b Merge branch 'main' into fix/gro-655-corepack-only 2026-04-15 02:02:07 +00:00
groombook-cto[bot] 67e2157975 feat(GRO-631): add graceful shutdown to API server (#292)
- Capture server instance from serve() call
- Add SIGTERM and SIGINT handlers for graceful shutdown
- Add 10-second forced exit timeout

Co-authored-by: Flea Flicker <flea-flicker@groombook.ai>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-15 01:54:00 +00:00
groombook-cto[bot] 46e2af446f fix(GRO-655): create corepack cache dir in builder stage
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-14 22:46:22 +00:00
+16 -1
View File
@@ -187,9 +187,24 @@ api.route("/search", searchRouter);
const port = Number(process.env.PORT ?? 3000);
await initAuth();
console.log(`API server listening on port ${port}`);
serve({ fetch: app.fetch, port });
const server = serve({ fetch: app.fetch, port });
// Start background reminder scheduler (runs every minute to check for upcoming appointments)
startReminderScheduler();
function shutdown() {
console.log("Shutting down gracefully...");
server.close(() => {
console.log("HTTP server closed");
process.exit(0);
});
setTimeout(() => {
console.error("Forced shutdown after timeout");
process.exit(1);
}, 10_000);
}
process.on("SIGTERM", shutdown);
process.on("SIGINT", shutdown);
export default app;