harrisiirak/cron-parser

cron job get stopped with no error automatically

spandey1296 opened this issue · 5 comments

I have scheduled cron on the server but it gets stopped automatically after 1-2 days or sometimes later.

Hi @spandey1296!

Do you have any actual example how are using this library and what is happening?

Best regards

@harrisiirak whenever the server gets restarted, some crons not get scheduled.
using cron package for it.

@spandey1296 this is cron-parser package and not responsible for scheduling a task.

If you can provide any example or reproducible case, I can provide more feedback or help.

Best regards

"cron": "^2.1.0",
const { CronJob } = require('cron');
let cronInstances = {}
// console.log("CRONT TIME ", row.time)
cronInstances[row._id] = new CronJob(row.time, async () => {
await cronServices.execute(row).catch(error => {
console.error(error)
})
// console.log("Cron Running : ", row.name)
})
cronInstances[row._id].start()

@spandey1296 cron and cron-parser are completely different packages. You seems to be using https://github.com/kelektiv/node-cron