Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fail a job #191

Closed
jbrooksuk opened this Issue · 1 comment

3 participants

@jbrooksuk

I'm building an application which runs Kue after a file has changed, it triggers a set of jobs and all is good. However I want to be able to purposefully fail a job if something goes wrong.

For example, I request a web page, but if the http.statusCode !== 200 the job should fail and no other job should be processed.

How do I go about that?

@bulkan

You can fail a job via

var kue = require('kue')
   , jobs = kue.createQueue();

jobs.process('email', function(job, done) {
    var err = new Error('purposely fail job');
    job.failed().error(err);
    done(err);
});

@drudge please close

@drudge drudge closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.