mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
turned around the logic
This commit is contained in:
parent
5a77247c79
commit
e9b8691b38
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user