From e9b8691b388aad7032d4db11316e318f62acc9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Mon, 18 Jul 2022 23:53:59 +0200 Subject: [PATCH] turned around the logic --- backend/src/config/index.ts | 2 +- backend/src/event/EventProtocolEmitter.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 240b4d61e..2120fce71 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -96,7 +96,7 @@ const webhook = { const eventProtocol = { // global switch to enable writing of EventProtocol-Entries - EVENT_PROTOCOL_ENABLED: process.env.EVENT_PROTOCOL_ENABLED || true, + EVENT_PROTOCOL_DISABLED: process.env.EVENT_PROTOCOL_DISABLED === 'true' || false, } // This is needed by graphql-directive-auth diff --git a/backend/src/event/EventProtocolEmitter.ts b/backend/src/event/EventProtocolEmitter.ts index 4ee092772..6dea99810 100644 --- a/backend/src/event/EventProtocolEmitter.ts +++ b/backend/src/event/EventProtocolEmitter.ts @@ -15,13 +15,13 @@ class EventProtocolEmitter { return this.events } - public isEnabled() { - logger.info(`EventProtocol - isEnabled=${CONFIG.EVENT_PROTOCOL_ENABLED}`) - return CONFIG.EVENT_PROTOCOL_ENABLED === true + public isDisabled() { + logger.info(`EventProtocol - isDisabled=${CONFIG.EVENT_PROTOCOL_DISABLED}`) + return CONFIG.EVENT_PROTOCOL_DISABLED === true } public async writeEvent(event: Event): Promise { - if (eventProtocol.isEnabled()) { + if (!eventProtocol.isDisabled()) { logger.info(`writeEvent(${JSON.stringify(event)})`) const dbEvent = new EventProtocol() dbEvent.type = event.type