-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.remove not working for scheduled unqiue jobs #38
Comments
@lykmapipo I am experiencing the same issue, is there a work around for this? |
+1 same case with me as well |
I ended up just using the
I hope this helps. |
@lykmapipo Example code: const redisConfig = {
"host": "localhost",
"port": 6379
};
const kue = require('kue');
const queue = require('kue-scheduler').createQueue({
redis: redisConfig
});
// schedule time is 20 seconds from now
let d = new Date();
d.setSeconds(d.getSeconds() + 20);
// creating a job
var job = queue
.createJob('example')
.attempts(3)
.priority('normal')
.unique('unique_every');
queue.schedule(d.toISOString(), job);
queue.process('example', function (job, done) {
console.log('Job processed');
done();
});
// attempting to remove the job before its first execution
queue.remove({
unique: 'unique_every'
}, (err, result) => {
console.log('Error', err);
console.log('Result', result);
}) Output: Error null
Result { removedJobInstance: null,
removedExpiryKey: 0,
removedJobData: 0 }
Job processed There should be a way of removing the job by its unique key before it got processed, right? |
Is there a way to do reschedule a unique job?
I have job which is scheduled to send notifications 1 hour before an activity starts. On updating the activity time I need to update the scheduled job or at least remove it and create a new one.
.remove( { unique: 'activityID1' } ) seems not working as I get this:
The text was updated successfully, but these errors were encountered: