node-cron icon indicating copy to clipboard operation
node-cron copied to clipboard

.stop() is not working for real time

Open ivayloc opened this issue 5 years ago • 2 comments

I have set up a cron job for a specific date and time, but when I call job.stop() on it, it is still executed.

ivayloc avatar Apr 20 '20 16:04 ivayloc

Can you provide a base sample that replicates what you're seeing? We have tests that use the job.stop() functionality so I'd be surprised if this wasn't working. But, I'm happy to take a look.

ncb000gt avatar Apr 27 '20 03:04 ncb000gt

This is how I am using it:

const job = new CronJob({
  cronTime: new Date(req.body.dateTime),
  onTick: async () => {},
  start: false,
  timeZone: timeZoneName,
})

ivayloc avatar May 03 '20 11:05 ivayloc