kue-scheduler
kue-scheduler copied to clipboard
Cannot read property 'expiryKey' of null when removing the job
The code below creates a queue and add the job successfully, however when removing the job from the queue, i got an error saying
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'expiryKey' of null at Queue.
(/root/mean2/node_modules/kue-scheduler/index.js:1327:22)
var job = _queue2
.createJob('nbiot_schedule_refresh_token', {'appid':app.appid,'password':app.password})
.attempts(3)
.priority('normal').removeOnComplete(true).save();
_queue2.every('*/300 * * * * *', job,function(err, job) {
console.log('job addTokenRefreshJob ',job.id);
});
_queue2.remove(app.job, function(err, response) {
});
Are you still having this issue @helxsz ? Thanks
@carlosmouracorreia : I had this error because the id sent to the remove function wasn't a Number