From 23d9b2bbda6407fc49df3d314b5ee8e97434743d Mon Sep 17 00:00:00 2001 From: Alan Fleming <> Date: Sun, 9 Jun 2024 14:23:31 +1000 Subject: [PATCH] Fix not awaiting delay promise in get_model. --- packages/base-manager/src/manager-base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/base-manager/src/manager-base.ts b/packages/base-manager/src/manager-base.ts index 7f578fd9ed..fb7fbcd303 100644 --- a/packages/base-manager/src/manager-base.ts +++ b/packages/base-manager/src/manager-base.ts @@ -217,7 +217,7 @@ export abstract class ManagerBase implements IWidgetManager { async get_model(model_id: string): Promise { 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) {