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() {
const extensions = await api.getExtensions();
for (const ext of extensions) {
try {
await import(api.apiURL(ext));
} catch (error) {
console.error("Error loading extension", ext, error);
}
}
await Promise.all(
extensions.map(async (ext) => {
try {
import(api.apiURL(ext));
} catch (error) {
console.error("Error loading extension", ext, error);
}
})
)
}
/**