Skip to content

Commit

Permalink
CB-6000 fix: retry update task info later if locked
Browse files Browse the repository at this point in the history
  • Loading branch information
SychevAndrey committed Dec 17, 2024
1 parent 2bc9e6f commit 5a285a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions webapp/packages/core-root/src/AsyncTask/AsyncTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,17 @@ export class AsyncTask {
}

async updateInfoAsync(getter: (task: AsyncTask) => Promise<AsyncTaskInfo>): Promise<void> {
const init = this.info === null;

if (this.updatingAsync) {
if (!init) {
setTimeout(() => this.updateInfoAsync.call(this, getter), 100);
}
return;
}

this.updatingAsync = true;
try {
const init = this.info === null;

if (this._cancelled && init) {
throw new Error('Task was cancelled');
}
Expand Down

0 comments on commit 5a285a7

Please sign in to comment.