Skip to content

Commit

Permalink
Restrict either the SSE or the Sync module to be active but not both (#…
Browse files Browse the repository at this point in the history
…224)

* chore: restrict sse and sync module

* chore: implement PR comments
  • Loading branch information
sebbi08 authored Aug 1, 2024
1 parent 82ea79a commit 982ff56
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function createConnectorConfig(overrides?: RuntimeConfig): ConnectorRunti
.file("config-env-file", { file: `config/${process.env.NODE_CONFIG_ENV}.json` })
.file("default-file", { file: "config/default.json" });

const connectorConfig = nconf.get();
const connectorConfig = nconf.get() as ConnectorRuntimeConfig;

if (typeof connectorConfig.modules.webhooksV2 !== "undefined") {
// eslint-disable-next-line no-console
Expand All @@ -38,6 +38,12 @@ export function createConnectorConfig(overrides?: RuntimeConfig): ConnectorRunti
delete connectorConfig.modules.webhooksV2;
}

if (connectorConfig.modules.sync.enabled && connectorConfig.modules.sse.enabled) {
// eslint-disable-next-line no-console
console.warn("The SSE and Sync modules cannot be enabled at the same time, the Sync module will be disabled.");
connectorConfig.modules.sync.enabled = false;
}

return connectorConfig;
}

Expand Down

0 comments on commit 982ff56

Please sign in to comment.