src/spider.js
function retryJob(job, when) {
  when = when || 'later';

  // Reaching maxRetries?
  if (job.req.retries >= this.options.maxRetries)
    return;

  // Dropping from remains
  delete this.remains[job.id];

  // Request
  job.req.retries++;
  job.state.retrying = true;

  // Adding to the queue again
  this.queue[when === 'now' ? 'unshift' : 'push'](job);

  this.emit('job:retry', job, when);
}
function retryJob(job, when) {
  when = when || 'later';

  // Reaching maxRetries?
  if (job.req.retries >= this.options.maxRetries)
    return;

  // Dropping from remains
  delete this.remains[job.id];

  // Request
  job.req.retries++;
  job.state.retrying = true;

  // Adding to the queue again
  this.queue[when === 'now' ? 'unshift' : 'push'](job);

  this.emit('job:retry', job, when);
}
function retryJob ( job , when ) { when = when || 'later' ; // Reaching maxRetries? if ( job . req . retries >= this . options . maxRetries ) return ; // Dropping from remains delete this . remains [ job . id ] ; // Request job . req . retries ++ ; job . state . retrying = true ; // Adding to the queue again this . queue [ when === 'now' ? 'unshift' : 'push' ] ( job ) ; this . emit ( 'job:retry' , job , when ) ; }
Retrying a job
Retrying a job