Skip to content

Commit

Permalink
fix: fix lastDate() value for intervals > 25 days
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed Oct 2, 2023
1 parent ea4705d commit a7c33f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ export class CronJob {
// again. This processing might make us miss the deadline by a few ms
// times the number of sleep sessions. Given a MAXDELAY of almost a
// month, this should be no issue.
this.lastExecution = new Date();
if (remaining) {
if (remaining > MAXDELAY) {
remaining -= MAXDELAY;
Expand All @@ -237,6 +236,7 @@ export class CronJob {
setCronTimeout(timeout);
} else {
// We have arrived at the correct point in time.
this.lastExecution = new Date();

this.running = false;

Expand Down

0 comments on commit a7c33f8

Please sign in to comment.