cron.js
cron.js copied to clipboard
Clear cron job
Hello. I need to delete cronJob object. How can i do it?
I also need to do this.
I have create it from forked current cron.js. You can use it:https://github.com/farkhad-alizade/cron.js
Thanks so much!
How would I stop it?
var job = new CronJob('*/10 * * * * *', function(){ console.log("please stop me"); });
I tried job.stop();
Thanks again
On Thu, Apr 30, 2015 at 11:26 PM, farkhad-alizade [email protected] wrote:
I have create it from forked current cron.js. You can use it: https://github.com/farkhad-alizade/cron.js
— Reply to this email directly or view it on GitHub https://github.com/padolsey/cron.js/issues/4#issuecomment-98057662.
just call stop method. job.stop(); Exactly!
Hmmm, getting a job.stop is not a function.
var job = new CronJob('*/10 * * * * *', function(){ console.log("running"); job.stop(); });
Any ideas :(
are you sure u forked cron.js from my repository , not from @padolsey ?
yes, I also ran through the cron.js code to make sure it had the stop logic.
Please, try this: var job = new CronJob('*/10 * * * * *', function(){ console.log("running"); }); job.stop();
Same issue, BUT I just manually set job.events = [] and job.isStopped = true and that did the trick!
Cheers!