Browse Source

fix(core): Correctly defer incomplete jobs on shutdown

Michael Bromley 4 years ago
parent
commit
d3fa83a091
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/core/src/job-queue/polling-job-queue-strategy.ts

+ 1 - 1
packages/core/src/job-queue/polling-job-queue-strategy.ts

@@ -71,7 +71,7 @@ class ActiveQueue<Data extends JobData<Data> = {}> {
                                 },
                                 },
                             )
                             )
                             .finally(() => {
                             .finally(() => {
-                                if (!this.running) {
+                                if (!this.running && nextJob.state !== JobState.PENDING) {
                                     return;
                                     return;
                                 }
                                 }
                                 nextJob.off('progress', onProgress);
                                 nextJob.off('progress', onProgress);