Skip to content

Commit

Permalink
revert: revert "fix: re-add runOnce property to CronJob (kelektiv#751)"
Browse files Browse the repository at this point in the history
This reverts commit a61d8c9.
  • Loading branch information
sheerlox committed Oct 29, 2023
1 parent 361728e commit 93111fe
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ export class CronJob<OC extends CronOnCompleteCommand | null = null, C = null> {
? CronOnCompleteCallback
: undefined;

get runOnce(): boolean {
return this.cronTime.realDate;
}

private _timeout?: NodeJS.Timeout;
private _callbacks: CronCallback<C, WithOnComplete<OC>>[] = [];

Expand Down Expand Up @@ -259,7 +255,7 @@ export class CronJob<OC extends CronOnCompleteCommand | null = null, C = null> {
this.running = false;

// start before calling back so the callbacks have the ability to stop the cron job
if (!this.runOnce) {
if (!this.cronTime.realDate) {
this.start();
}

Expand Down

0 comments on commit 93111fe

Please sign in to comment.