kue-scheduler icon indicating copy to clipboard operation
kue-scheduler copied to clipboard

deleting job without expiryKey?

Open stevenpalomino opened this issue 7 years ago • 3 comments

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?

stevenpalomino avatar Jun 08 '17 14:06 stevenpalomino

Per the docs, you can use queue.remove({ unique: 'myJob' }) where myJob is the job name.

samhunta avatar Jun 25 '17 22:06 samhunta

@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 avatar Sep 01 '17 21:09 crossman

@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));
});

rafaismyname avatar Oct 24 '17 21:10 rafaismyname