From 1095ad17c6c55ca253d94841bacbe70ec96d1b11 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 31 Jan 2022 17:27:47 +0000 Subject: [PATCH] Adding comments to areas that need to keep using old db creation method. --- packages/server/src/automations/utils.js | 3 +++ packages/server/src/utilities/usageQuota/rows.js | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/server/src/automations/utils.js b/packages/server/src/automations/utils.js index 6c1d8b2fdf..1d8a03f26d 100644 --- a/packages/server/src/automations/utils.js +++ b/packages/server/src/automations/utils.js @@ -93,6 +93,9 @@ exports.enableCronTrigger = async (appId, automation) => { ) // Assign cron job ID from bull so we can remove it later if the cron trigger is removed trigger.cronJobId = job.id + // can't use getAppDB here as this is likely to be called from dev app, + // but this call could be for dev app or prod app, need to just use what + // was passed in const db = new CouchDB(appId) const response = await db.put(automation) automation._id = response.id diff --git a/packages/server/src/utilities/usageQuota/rows.js b/packages/server/src/utilities/usageQuota/rows.js index 67ad07410d..378caffc46 100644 --- a/packages/server/src/utilities/usageQuota/rows.js +++ b/packages/server/src/utilities/usageQuota/rows.js @@ -23,6 +23,7 @@ const getAppPairs = appIds => { } const getAppRows = async appId => { + // need to specify the app ID, as this is used for different apps in one call const appDb = new CouchDB(appId) const response = await appDb.allDocs( getRowParams(null, null, {