PR comments.
This commit is contained in:
parent
0a7ceda807
commit
d2987fcf39
|
@ -67,7 +67,10 @@ export const getTenantIDFromAppID = (appId: string) => {
|
||||||
|
|
||||||
// used for automations, API endpoints should always be in context already
|
// used for automations, API endpoints should always be in context already
|
||||||
export const doInTenant = (tenantId: string | null, task: any) => {
|
export const doInTenant = (tenantId: string | null, task: any) => {
|
||||||
tenantId = tenantId || DEFAULT_TENANT_ID
|
// make sure default always selected in single tenancy
|
||||||
|
if (!env.MULTI_TENANCY) {
|
||||||
|
tenantId = tenantId || DEFAULT_TENANT_ID
|
||||||
|
}
|
||||||
// the internal function is so that we can re-use an existing
|
// the internal function is so that we can re-use an existing
|
||||||
// context - don't want to close DB on a parent context
|
// context - don't want to close DB on a parent context
|
||||||
async function internal(opts = { existing: false }) {
|
async function internal(opts = { existing: false }) {
|
||||||
|
|
Loading…
Reference in New Issue