Created
July 13, 2017 11:12
-
-
Save bobwei/839a49e6837da57f95b6b90b626e0cee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dotenv/config'; | |
import { CronJob } from 'cron'; | |
const { JOB1_CRON_TIME } = process.env; | |
new CronJob({ | |
cronTime: JOB1_CRON_TIME, | |
onTick: () => { | |
console.log('do your job'); | |
}, | |
start: true, | |
runOnInit: true, | |
timeZone: 'UTC', | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment