kue-scheduler
kue-scheduler copied to clipboard
deleting job without expiryKey?
Currently I have a job running every hour and new jobs get created at times but there's no expiryKey until they run for the first time. Is there a way to delete a job without expiryKey?
Per the docs, you can use queue.remove({ unique: 'myJob' })
where myJob
is the job name.
@samhunta have you actually gotten that to work? I'm trying to remove jobs by unique
right now and they don't get removed. I took a look at the spec and it appears there is no test for that functionality either.
@crossman we had the very same issue! the solution was to query for the job id directly to redis, and then use .remove(jobId)
:(
kue.client.hget('[myPrefix]:unique:jobs', myUniqueId, (id) => {
kue.remove(Number(id), (err, result) => console.log(err, result));
});