From 86f7bd192fb4c6bbe12636e94cca69dc28957d23 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 3 Nov 2023 14:55:56 +0000 Subject: [PATCH] Moving audit log init to be part of the server startup. --- packages/worker/src/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/worker/src/index.ts b/packages/worker/src/index.ts index 3905a21c73..4b1d11ecf7 100644 --- a/packages/worker/src/index.ts +++ b/packages/worker/src/index.ts @@ -31,10 +31,6 @@ import destroyable from "server-destroy" import { initPro } from "./initPro" import { handleScimBody } from "./middleware/handleScimBody" -// configure events to use the pro audit log write -// can't integrate directly into backend-core due to cyclic issues -events.processors.init(proSdk.auditLogs.write) - if (coreEnv.ENABLE_SSO_MAINTENANCE_MODE) { console.warn( "Warning: ENABLE_SSO_MAINTENANCE_MODE is set. It is recommended this flag is disabled if maintenance is not in progress" @@ -93,6 +89,9 @@ export default server.listen(parseInt(env.PORT || "4002"), async () => { console.log(`Worker running on ${JSON.stringify(server.address())}`) await initPro() await redis.init() + // configure events to use the pro audit log write + // can't integrate directly into backend-core due to cyclic issues + await events.processors.init(proSdk.auditLogs.write) }) process.on("uncaughtException", err => {