turned around the logic

This commit is contained in:
Claus-Peter Hübner 2022-07-18 23:53:59 +02:00
parent 5a77247c79
commit e9b8691b38
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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<void> {
if (eventProtocol.isEnabled()) {
if (!eventProtocol.isDisabled()) {
logger.info(`writeEvent(${JSON.stringify(event)})`)
const dbEvent = new EventProtocol()
dbEvent.type = event.type