redibox / job

High performance, robust and flexible queue/worker system powered by redis.
MIT License
8 stars 0 forks source link

Job#retry() doesn't fire #8

Closed Ehesp closed 8 years ago

Ehesp commented 8 years ago

Trying to build a test for the Job rety() method, however hitting an issue:

  it('Should allow the instance of the job to retry itself', (done) => {
    let count = 0;
    global.singleJob = function queueHandler() {
      console.log('doing job')
      count++;
      if (count === 2) {
        return done();
      }
      return Promise.reject();
    };

    const job = Hook.create('test', {
      runs: 'singleJob',
    }).onFailure(() => {
      job.retry();
    });
  });

job.retry(); is a function, but since it's a multi-exec it's async, but doesn't seem to be triggering the second job.

Ehesp commented 8 years ago

Fixed in v2