core: fix concurrent load of locale

This commit is contained in:
undefined committed 2022-10-24 02:57:28 +08:00
1 parent c00c2160ec
commit 174dd08fff
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -68,7 +68,7 @@ export async function builtinModel(ctx: Context) {
}
export async function locale(pending: string[], fail: string[]) {
await Promise.all(pending.map(async (i) => {
for (const i of pending) {
const p = locateFile(i, ['locale', 'locales']);
if (p && (await fs.stat(p)).isDirectory() && !fail.includes(i)) {
try {
@@ -86,7 +86,7 @@ export async function locale(pending: string[], fail: string[]) {
logger.error(e);
}
}
}));
}
await bus.parallel('app/load/locale');
}