Skip to content

Commit 05433c9

Browse files
committed
feat: Wait for importAllConfig to finish
1 parent 821a6a0 commit 05433c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

services/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,16 @@ module.exports = {
149149

150150
const diff = difference(databaseConfig, fileConfig);
151151

152-
Object.keys(diff).map((file) => {
152+
await Promise.all(Object.keys(diff).map(async (file) => {
153153
const type = file.split('.')[0]; // Grab the first part of the filename.
154154
const name = file.split(/\.(.+)/)[1]; // Grab the rest of the filename minus the file extension.
155155

156156
if (configType && configType !== type) {
157157
return;
158158
}
159159

160-
strapi.plugins['config-sync'].services.main.importSingleConfig(type, name);
161-
});
160+
await strapi.plugins['config-sync'].services.main.importSingleConfig(type, name);
161+
}));
162162
},
163163

164164
/**

0 commit comments

Comments
 (0)