Skip to content

Commit b674141

Browse files
authored
fix(cron): fix cron job not running (#31)
the job not auto running by default
1 parent 5cf7c90 commit b674141

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Back/task.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {getUser} from './utils/getUser'
66
const task =
77
async () => {
88
try {
9-
new CronJob('0 0 * * 0', async () => { await getUser(); })
9+
const job = new CronJob('0 0 * * 0', async () => { await getUser(); })
10+
job.start();
1011
} catch (error) {
1112
console.log(error);
1213
}

0 commit comments

Comments
 (0)