Parallelize plug loads
This commit is contained in:
parent
c1a78e0105
commit
09b20cadd8
@ -528,11 +528,10 @@ export class Editor {
|
|||||||
await this.space.updatePageList();
|
await this.space.updatePageList();
|
||||||
await this.system.unloadAll();
|
await this.system.unloadAll();
|
||||||
console.log("(Re)loading plugs");
|
console.log("(Re)loading plugs");
|
||||||
for (const plugName of await this.space.listPlugs()) {
|
await Promise.all((await this.space.listPlugs()).map(async (plugName) => {
|
||||||
// console.log("Loading plug", pageInfo.name);
|
|
||||||
const { data } = await this.space.readAttachment(plugName, "string");
|
const { data } = await this.space.readAttachment(plugName, "string");
|
||||||
await this.system.load(JSON.parse(data as string), createIFrameSandbox);
|
await this.system.load(JSON.parse(data as string), createIFrameSandbox);
|
||||||
}
|
}));
|
||||||
this.rebuildEditorState();
|
this.rebuildEditorState();
|
||||||
await this.dispatchAppEvent("plugs:loaded");
|
await this.dispatchAppEvent("plugs:loaded");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user