link creation/deletion

This commit is contained in:
2024-07-30 19:25:23 +05:30
parent a634ea0fb2
commit 971698b318
10 changed files with 317 additions and 30 deletions

View File

@@ -68,13 +68,14 @@ const server = app.listen(port, () => {
});
const cleanupFunc = (signal) => {
if (signal)
logger.info(`${signal} signal received, shutting down now...`);
Promise.allSettled([
db.sequelize.close(),
util.promisify(server.close),
]).then(() => {
if (signal)
logger.info(`Caught ${signal} signal`);
logger.info("Cleaned up, exiting...");
logger.info("Cleaned up, exiting.");
process.exit(0);
});
}