Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict either the SSE or the Sync module to be active but not both #224

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
jkoenig134 marked this conversation as resolved.
Show resolved Hide resolved

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