Skip to content

Commit

Permalink
Fix not awaiting delay promise in get_model.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Fleming committed Jun 9, 2024
1 parent 70864f9 commit 23d9b2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/base-manager/src/manager-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export abstract class ManagerBase implements IWidgetManager {
async get_model(model_id: string): Promise<WidgetModel> {
let i = 0;
while (!this._models[model_id] && i < this._sleepTimes.length) {
new Promise((resolve) => setTimeout(resolve, this._sleepTimes[i++]));
await new Promise((resolve) => setTimeout(resolve, this._sleepTimes[i++]));
}
const modelPromise = this._models[model_id];
if (modelPromise === undefined) {
Expand Down

0 comments on commit 23d9b2b

Please sign in to comment.