Add module var for shutdown timeout

This commit is contained in:
Alex Holliday
2024-10-31 17:01:27 +08:00
parent 3fc79d47ba
commit c83e2cb6f2

View File

@@ -44,6 +44,7 @@ import NotificationService from "./service/notificationService.js";
import db from "./db/mongo/MongoDB.js";
const SERVICE_NAME = "Server";
const SHUTDOWN_TIMEOUT = 0;
let isShuttingDown = false;
const __filename = fileURLToPath(import.meta.url);
@@ -154,7 +155,7 @@ const startApp = async () => {
method: "shutdown",
});
process.exit(1);
}, 2000);
}, SHUTDOWN_TIMEOUT);
try {
server.close();
await jobQueue.obliterate();