Skip to content

Commit

Permalink
autopilot proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
codeautopilot[bot] committed Feb 10, 2025
1 parent bc03a25 commit 4f22959
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,19 @@ process.on('SIGTERM', shutdown);

function shutdown() {
console.log('SIGTERM signal received: closing HTTP server');
server.close();
process.exit(0);
server.close((err) => {
if (err) {
console.error('Error during server shutdown:', err);
process.exit(1);
}
console.log('HTTP server closed gracefully');
// Here you can close database connections or other resources
// db.close(() => {
// console.log('Database connection closed');
// process.exit(0);
// });
process.exit(0);
});
}

server.listen({
Expand Down

0 comments on commit 4f22959

Please sign in to comment.