Search code examples
javascriptnode.jsparse-serverkue

NodeJS, ParseServer, kue-scheduler Query.every


I'm using ParseServer(v2.2.16) and kue-sheduler(v0.6.0), my Query.every looks like: Queue.every('0 12 * * *', job);, what I expect is that the cron format will initiate the job every day at 12pm, I've tried so many formats but nothing works, after an hour or so the task initiates, maybe there is another format I should try?, is my format wrong?, is it something else?


Solution

  • Actually kue-scheduler using node-cron that uses following format

    • Seconds: 0-59
    • Minutes: 0-59
    • Hours: 0-23
    • Day of Month: 1-31
    • Months: 0-11
    • Day of Week: 0-6

    that mean you cron format would be

    Queue.every('00 00 12 * * *', job);
    

    References: https://www.npmjs.com/package/kue-scheduler & https://github.com/ncb000gt/node-cron