Skip to content

Commit

Permalink
fix(cron): fix cron job not running (#31)
Browse files Browse the repository at this point in the history
the job not auto running by default
  • Loading branch information
colinaaa authored Mar 9, 2021
1 parent 5cf7c90 commit b674141
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Back/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {getUser} from './utils/getUser'
const task =
async () => {
try {
new CronJob('0 0 * * 0', async () => { await getUser(); })
const job = new CronJob('0 0 * * 0', async () => { await getUser(); })
job.start();
} catch (error) {
console.log(error);
}
Expand Down

0 comments on commit b674141

Please sign in to comment.