Skip to content

Commit

Permalink
fix: ensure check if job is dead is ending sometime :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
simllll committed Oct 15, 2020
1 parent 9cdbf25 commit 39950f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hokify/agenda",
"version": "4.0.19",
"version": "4.0.20",
"description": "Light weight job scheduler for Node.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions src/JobProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ export class JobProcessor {
);
return;
}
// when job is not running anymore, just finish
if (!job.isRunning()) {
resolve();
return;
}
resolve(checkIfJobIsDead());
}, this.processEvery)
);
Expand Down

0 comments on commit 39950f3

Please sign in to comment.