Update app.js Parallel import

This commit is contained in:
yikakia 2023-07-16 02:32:16 +08:00 committed by yikakia
parent 490771b7f4
commit d4d3c2c2f8

View File

@ -1003,13 +1003,15 @@ export class ComfyApp {
*/ */
async #loadExtensions() { async #loadExtensions() {
const extensions = await api.getExtensions(); const extensions = await api.getExtensions();
for (const ext of extensions) { await Promise.all(
try { extensions.map(async (ext) => {
await import(api.apiURL(ext)); try {
} catch (error) { import(api.apiURL(ext));
console.error("Error loading extension", ext, error); } catch (error) {
} console.error("Error loading extension", ext, error);
} }
})
)
} }
/** /**