Skip to content

Commit

Permalink
fix: wrap functions (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbystedt authored Apr 23, 2024
1 parent b53201c commit 4c52b04
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/services/job.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,20 @@ export class JobService {
}

public async runCron() {
const rotateCronJob = Cron(CRON_ROTATE, this.rotate);
const rotateCronJob = Cron(CRON_ROTATE, () => {
this.rotate();
});
const compressCronJob = COMPRESS_SKIP
? null
: Cron(CRON_COMPRESS, this.compress);
const backupCronJob = Cron(CRON_BACKUP, this.backup);
const janitorCronJob = Cron(CRON_JANITOR, this.janitor);
: Cron(CRON_COMPRESS, () => {
this.compress();
});
const backupCronJob = Cron(CRON_BACKUP, () => {
this.backup();
});
const janitorCronJob = Cron(CRON_JANITOR, () => {
this.janitor();
});

console.log(`Backup job next run: ${backupCronJob.nextRun()}`);
if (compressCronJob) {
Expand Down

0 comments on commit 4c52b04

Please sign in to comment.