Skip to content

Commit

Permalink
fix(worker): always try to move to active after waiting for job (#914)
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Dec 3, 2021
1 parent c67aa6c commit 97b7084
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/classes/worker.ts
Expand Up @@ -335,10 +335,7 @@ export class Worker<
if (this.drained && block) {
try {
const jobId = await this.waitForJob();

if (jobId) {
return this.moveToActive(token, jobId);
}
return this.moveToActive(token, jobId);
} catch (err) {
// Swallow error if locally paused or closing since we did force a disconnection
if (
Expand Down Expand Up @@ -516,7 +513,7 @@ export class Worker<
async pause(doNotWaitActive?: boolean): Promise<void> {
if (!this.paused) {
this.paused = new Promise(resolve => {
this.resumeWorker = function() {
this.resumeWorker = function () {
resolve();
this.paused = null; // Allow pause to be checked externally for paused state.
this.resumeWorker = null;
Expand Down

0 comments on commit 97b7084

Please sign in to comment.