Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

handle siginit and sigterm

Maidul Islam3456dfbd86a5
diff --git a/backend/src/index.ts b/backend/src/index.ts
index 2a5159738c..994e24cc1d 100644
--- a/backend/src/index.ts
+++ b/backend/src/index.ts
@@ -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;