lykmapipo / kue-scheduler

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

Check existing job using job Id #87

Closed leizard closed 7 years ago

leizard commented 7 years ago

Hi, How can I check if a job with an existing job Id exists before calling Queue.createJob() ?

adampatarino commented 7 years ago

@leizard try using Kue's get function:

kue.Job.get( id, function( err, job ) {
    // err - job doesn't exist
   // job - found a job with that id
});
lykmapipo commented 7 years ago

@leizard kue-scheduler its just a utility on top of kue and we tried as much as we can not to over-rule kue logics. So anything applies in kue is same as in kue-scheduler and infact kue-scheduler export the same kue queue instance.

So @adampatarino point it correctly.

Hope it helps.