new(all): Paralel bot loading.
This commit is contained in:
parent
24a3af5051
commit
1db979ddbf
1 changed files with 7 additions and 8 deletions
|
@ -201,20 +201,19 @@ export class GBMinService {
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
const p = (async (instance) => {
|
await throttledPromiseAll(instances.map((async instance => {
|
||||||
try {
|
try {
|
||||||
this.bar1.update(i, { botId: instance.botId });
|
this.bar1.update(i, { botId: instance.botId });
|
||||||
|
|
||||||
await this['mountBot'](instance);
|
await this['mountBot'](instance);
|
||||||
GBDeployer.mountGBKBAssets(`${instance.botId}.gbkb`,
|
GBDeployer.mountGBKBAssets(`${instance.botId}.gbkb`,
|
||||||
instance.botId, `${instance.botId}.gbkb`);
|
instance.botId, `${instance.botId}.gbkb`);
|
||||||
i++;
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
GBLog.error(`Error mounting bot ${instance.botId}: ${error.message}\n${error.stack}`);
|
GBLog.error(`Error mounting bot ${instance.botId}: ${error.message}\n${error.stack}`);
|
||||||
}
|
}
|
||||||
}).bind(this);
|
|
||||||
|
|
||||||
await throttledPromiseAll(instances.map(instance => p(instance)));
|
}).bind(this)));
|
||||||
|
|
||||||
this.bar1.stop();
|
this.bar1.stop();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue