Closed trsh closed 8 years ago
I have set wait = 1000 (1 second), yet it repeats after constantly after 15 seconds.
Code:
Meteor.startup(function () {
var job = null; var nextImageJob = jobs.findOne({type: 'imageNext'}); //console.log(nextImageJob); //return false; if(!nextImageJob){ job = new Job(jobs, 'imageNext', { duno: true } ); job.priority('normal') .retry({ retries: 5, wait: 5 * 60 * 1000 }) // 5 minutes between attempts .repeat({ wait: 1000 }).save(); }else{ job = new Job(jobs, nextImageJob); } if(job) { var q = jobs.processJobs( 'imageNext', { pollInterval: 1000000000 }, function (job, callback) { console.log('aaaaaaaaaaaaaaa'); job.done(); callback(); } ); jobs.find({type: 'imageNext', status: 'ready'}) .observe({ added: function () { q.trigger(); } }); } });
Hi, you need to decrease the time of the server job promotion cycle.
https://github.com/vsivsi/meteor-job-collection#jcpromotemilliseconds---server-only
Thanks, will try tomorrow & close if it works.
I have set wait = 1000 (1 second), yet it repeats after constantly after 15 seconds.
Code:
Meteor.startup(function () {