From c549e3d44dd17047df6b7bcd7a3eefd39af52d9d Mon Sep 17 00:00:00 2001 From: Cookiezaurs <> Date: Mon, 25 Nov 2024 15:56:58 +0200 Subject: [PATCH] [core] Loading configs before processing aggregated data regeneration --- bin/scripts/fix-data/regenerate_aggregated_data.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/scripts/fix-data/regenerate_aggregated_data.js b/bin/scripts/fix-data/regenerate_aggregated_data.js index 2e7aaa1b98c..1a69ee7b644 100644 --- a/bin/scripts/fix-data/regenerate_aggregated_data.js +++ b/bin/scripts/fix-data/regenerate_aggregated_data.js @@ -40,6 +40,12 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" query._id = {$in: appList.map(app_id=>common.db.ObjectID(app_id))}; } const apps = await countlyDb.collection("apps").find(query, {_id: 1, name: 1, timezone: 1}).toArray(); + + await new Promise((resolve)=>{ + common.plugins.loadConfigs(countlyDb, function() { + resolve(); + }); + }); if (!apps || !apps.length) { return close(); }