Skip to content

Commit a9e4cd9

Browse files
committed
feat: Load plugins concurrently
1 parent 384be75 commit a9e4cd9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/loadPlugins.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export default async function loadPlugins() {
1010
toast(strings["loading plugins"]);
1111
}
1212

13-
// Load plugins sequentially to better handle errors
14-
for (const pluginDir of plugins) {
13+
// Load plugins concurrently
14+
const loadPromises = plugins.map(async (pluginDir) => {
1515
const pluginId = Url.basename(pluginDir.url);
1616
try {
1717
await loadPlugin(pluginId);
@@ -22,7 +22,8 @@ export default async function loadPlugins() {
2222
toast(`Failed to load plugin: ${pluginId}`);
2323
results.push(false);
2424
}
25-
}
25+
});
2626

27+
await Promise.allSettled(loadPromises);
2728
return results.filter(Boolean).length;
2829
}

0 commit comments

Comments
 (0)