From 05433c9c8cac76fb07754320826e2c1c2ff03555 Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Sat, 16 Oct 2021 11:47:44 +0200 Subject: [PATCH] feat: Wait for importAllConfig to finish --- services/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/main.js b/services/main.js index 9537d13..d4c5b6e 100644 --- a/services/main.js +++ b/services/main.js @@ -149,7 +149,7 @@ module.exports = { const diff = difference(databaseConfig, fileConfig); - Object.keys(diff).map((file) => { + await Promise.all(Object.keys(diff).map(async (file) => { const type = file.split('.')[0]; // Grab the first part of the filename. const name = file.split(/\.(.+)/)[1]; // Grab the rest of the filename minus the file extension. @@ -157,8 +157,8 @@ module.exports = { return; } - strapi.plugins['config-sync'].services.main.importSingleConfig(type, name); - }); + await strapi.plugins['config-sync'].services.main.importSingleConfig(type, name); + })); }, /**