From 8d308b591aed2a9fcd176f435f1d1ee685b84652 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 11 Jul 2024 13:33:56 +0100 Subject: [PATCH] Enabled SQS in self-host/development (single tenancy) as long as the SQS_ENABLED flag has been set, tenants don't need to be specified as there are no tenants. --- packages/backend-core/src/db/utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts index 5aad05d3e3..a7ad453066 100644 --- a/packages/backend-core/src/db/utils.ts +++ b/packages/backend-core/src/db/utils.ts @@ -1,6 +1,6 @@ import env from "../environment" import { DEFAULT_TENANT_ID, SEPARATOR, DocumentType } from "../constants" -import { getTenantId, getGlobalDBName } from "../context" +import { getTenantId, getGlobalDBName, isMultiTenant } from "../context" import { doWithDB, directCouchAllDbs } from "./db" import { AppState, DeletedApp, getAppMetadata } from "../cache/appMetadata" import { isDevApp, isDevAppID, getProdAppID } from "../docIds/conversions" @@ -213,6 +213,11 @@ export function isSqsEnabledForTenant(): boolean { return false } + // single tenant (self host and dev) always enabled if flag set + if (!isMultiTenant()) { + return true + } + // This is to guard against the situation in tests where tests pass because // we're not actually using SQS, we're using Lucene and the tests pass due to // parity.