requested changes

This commit is contained in:
Daniel Hougaard
2024-11-11 21:45:06 +04:00
parent d0b3c6b66a
commit 8d4115925c
15 changed files with 47 additions and 59 deletions
+6 -6
View File
@@ -9,7 +9,7 @@ import { initLogger } from "./lib/logger";
import { queueServiceFactory } from "./queue";
import { main } from "./server/app";
import { bootstrapCheck } from "./server/boot-strap-check";
import { initializePkcs11Module } from "./services/hsm/hsm-fns";
import { initializeHsmModule } from "./services/hsm/hsm-fns";
import { smtpServiceFactory } from "./services/smtp/smtp-service";
dotenv.config();
@@ -54,17 +54,17 @@ const run = async () => {
const queue = queueServiceFactory(appCfg.REDIS_URL);
const keyStore = keyStoreFactory(appCfg.REDIS_URL);
const pkcs11Module = initializePkcs11Module();
pkcs11Module.initialize();
const hsmModule = initializeHsmModule();
hsmModule.initialize();
const server = await main({ db, auditLogDb, hsmModule: pkcs11Module.getModule(), smtp, logger, queue, keyStore });
const server = await main({ db, auditLogDb, hsmModule: hsmModule.getModule(), smtp, logger, queue, keyStore });
const bootstrap = await bootstrapCheck({ db });
// eslint-disable-next-line
process.on("SIGINT", async () => {
await server.close();
await db.destroy();
pkcs11Module.finalize();
hsmModule.finalize();
process.exit(0);
});
@@ -72,7 +72,7 @@ const run = async () => {
process.on("SIGTERM", async () => {
await server.close();
await db.destroy();
pkcs11Module.finalize();
hsmModule.finalize();
process.exit(0);
});