Skip to content

Commit

Permalink
Merge pull request #4155 from Tyriar/fix_priority_queue
Browse files Browse the repository at this point in the history
Fix priority task queue and idle callback fallback
  • Loading branch information
Tyriar authored Sep 27, 2022
2 parents 37c722d + 8201925 commit c6df208
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/TaskQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract class TaskQueue implements ITaskQueue {

public clear(): void {
if (this._idleCallback) {
cancelIdleCallback(this._idleCallback);
this._cancelCallback(this._idleCallback);
this._idleCallback = undefined;
}
this._i = 0;
Expand All @@ -58,11 +58,11 @@ abstract class TaskQueue implements ITaskQueue {

private _start(): void {
if (!this._idleCallback) {
this._idleCallback = requestIdleCallback(this._process.bind(this));
this._idleCallback = this._requestCallback(this._process.bind(this));
}
}

private _process(deadline: IdleDeadline): void {
private _process(deadline: ITaskDeadline): void {
this._idleCallback = undefined;
let taskDuration = 0;
let longestTask = 0;
Expand Down

0 comments on commit c6df208

Please sign in to comment.