We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7282cf commit 6370778Copy full SHA for 6370778
1 file changed
server/src/index.ts
@@ -72,6 +72,12 @@ httpServer.listen(PORT, () => {
72
const handleShutdown = async (signal: string) => {
73
console.log(`\n[INFO] Received ${signal}. Initiating graceful shutdown...`);
74
75
+ // Force exit after 10s if graceful shutdown hangs
76
+ setTimeout(() => {
77
+ console.error('[ERROR] Graceful shutdown timed out. Forcing exit.');
78
+ process.exit(1);
79
+ }, 10000).unref();
80
+
81
try {
82
// Stop accepting new connections
83
httpServer.close();
0 commit comments