Skip to content

Commit

Permalink
fix(delayed): re-schedule updateDelay in case of error fixes #2015
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Apr 23, 2021
1 parent 5649689 commit 16bbfad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

* **obliterate:** obliterate many jobs fixes [#2016](https://github.com/OptimalBits/bull/issues/2016) ([7a923b4](https://github.com/OptimalBits/bull/commit/7a923b468d5299bbdfe06d1ee7447fd810e2779b))

# Changelog

## v.3.22.1

Expand Down
8 changes: 8 additions & 0 deletions lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,14 @@ Queue.prototype.updateDelayTimer = function() {
})
.catch(err => {
this.emit('error', err, 'Error updating the delay timer');
if (this.delayTimer) {
clearTimeout(this.delayTimer);
}

this.delayTimer = setTimeout(
() => this.updateDelayTimer(),
this.settings.guardInterval
);
});
};

Expand Down

0 comments on commit 16bbfad

Please sign in to comment.