mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 10:25:16 +00:00
Make the extensions loads in parallel instead of waiting one by one
This commit is contained in:
parent
b80c3276dc
commit
81ccacaa7c
@ -1026,18 +1026,21 @@ export class ComfyApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads all extensions from the API into the window
|
* Loads all extensions from the API into the window in parallel
|
||||||
*/
|
*/
|
||||||
async #loadExtensions() {
|
async #loadExtensions() {
|
||||||
const extensions = await api.getExtensions();
|
const extensions = await api.getExtensions();
|
||||||
this.logging.addEntry("Comfy.App", "debug", { Extensions: extensions });
|
this.logging.addEntry("Comfy.App", "debug", { Extensions: extensions });
|
||||||
for (const ext of extensions) {
|
|
||||||
try {
|
const extensionPromises = extensions.map(async ext => {
|
||||||
await import(api.apiURL(ext));
|
try {
|
||||||
} catch (error) {
|
await import(api.apiURL(ext));
|
||||||
console.error("Error loading extension", ext, error);
|
} catch (error) {
|
||||||
}
|
console.error("Error loading extension", ext, error);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await Promise.all(extensionPromises);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user