0

I wish to schedule a task in my node.JS project to run in 12 hours from the time of schedule. I tried using 0 */12 * * * but it can only run at the 12th hour. How to do please?

1 Answers1

0

You can give a try to Bull.js. I never used it for scheduling task (only one task after xx minutes). But according to their documentation, you can schedule/repeat a task.

Example code:

paymentsQueue.process(function(job){
    // Check payments
});

 // Repeat payment job once every day at 3:15 (am)
 paymentsQueue.add(paymentsData, {repeat: {cron: '15 3 * * *'}});

Link to doc

Quite easy to use as it follows cron expression descriptor

SebUndefined
  • 157
  • 10