1
0
mirror of https://github.com/Infisical/infisical.git synced 2025-03-29 22:02:57 +00:00

handle siginit and sigterm

This commit is contained in:
Maidul Islam
2023-10-02 11:40:00 -07:00
parent 560bde297c
commit 3456dfbd86

@ -225,8 +225,19 @@ const main = async () => {
server.on("close", async () => {
await DatabaseService.closeDatabase();
syncSecretsToThirdPartyServices.close();
githubPushEventSecretScan.close();
// TODO: prevent queue from trying to reconnect with redis after .close
syncSecretsToThirdPartyServices.close()
githubPushEventSecretScan.close()
});
process.on("SIGINT", function () {
server.close();
process.exit(0);
});
process.on("SIGTERM", function () {
server.close();
process.exit(0);
});
return server;