Skip to content

Commit

Permalink
Merge pull request OptimalBits#1534 from gabegorelick/pause
Browse files Browse the repository at this point in the history
fix: queue.pause(true, true) doesn't pause queue
  • Loading branch information
manast authored Nov 5, 2019
2 parents f20e2f9 + 52b387f commit d99f7f6
Show file tree
Hide file tree
Showing 2 changed files with 326 additions and 271 deletions.
10 changes: 9 additions & 1 deletion lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,15 @@ Queue.prototype.pause = function(isLocal, doNotWaitActive) {
};
});
}
return !doNotWaitActive && this.whenCurrentJobsFinished();

if (doNotWaitActive) {
// Force reconnection of blocking connection to abort blocking redis call immediately.
return redisClientDisconnect(this.bclient).then(() => {
return this.bclient.connect();
});
}

return this.whenCurrentJobsFinished();
} else {
return scripts.pause(this, true);
}
Expand Down
Loading

0 comments on commit d99f7f6

Please sign in to comment.