Bull: [SUGGESTION] Reset finishedOn, processedOn and failedReason on job.retry

Created on 23 Oct 2018  路  4Comments  路  Source: OptimalBits/bull

Hello,

I would like to suggest to reset to null the failedReason, processedOn finishedOn fields whenever job.retry is used in order to allow code based on those fields to do further processing until job completes/fails.

Thank you for your time.

enhancement

Most helpful comment

@manast cool I will do it asap, just wanted to see if you approve first!

All 4 comments

I worked around the issue like this for now:

class ExtendedJob extends Queue.Job {
  async retry() {
    this.failedReason = null;
    this.finishedOn = null;
    this.processedOn = null;

    await this.queue.client.hmset(
      this.queue.toKey(this.id),
      'finishedOn',
      this.finishedOn,
      'processedOn',
      this.processedOn
    );

    await this.queue.client.hdel(this.queue.toKey(this.id), 'failedReason');

    super.retry();
  }
}

could easily be converted into a PR 馃拑

@manast cool I will do it asap, just wanted to see if you approve first!

PR #1106

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianstormtaylor picture ianstormtaylor  路  4Comments

joe-at-startupmedia picture joe-at-startupmedia  路  3Comments

thelinuxlich picture thelinuxlich  路  3Comments

DevBrent picture DevBrent  路  4Comments

sibelius picture sibelius  路  3Comments