lykmapipo / kue-scheduler

A job scheduler utility for kue, backed by redis and built for node.js
246 stars 47 forks source link

deleting job without expiryKey? #98

Open stevenpalomino opened 7 years ago

stevenpalomino commented 7 years ago

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?

samhunta commented 7 years ago

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

crossman commented 6 years ago

@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.

rafaismyname commented 6 years ago

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