Skip to content

Job.processCount

Grant Carthew edited this page Nov 20, 2016 · 1 revision

Property Details

Usage: Read Only

Get: Number

  • Returns the number of times a job has or has attempted to be processed.

Example:

const Queue = require('rethinkdb-job-queue')
const q = new Queue()
let job = q.createJob()

q.addJob(job).then(() => {
  return q.getJob(job.id)
}).then((savedJobs) => {
  let processCount = savedJobs[0].processCount 
  // processCount === 0
}).catch(err => console.error(err))

Description

When a job is retrieved from the queue table for processing, the Job.processCount value is incremented. This property was added to support repeating jobs however it can be useful for a number or other reasons. Whenever a job log is created this value is added to the log entry also.

This property does not report the number of times the job was processed to completion. More accurately it reports the number of times the job was attempted. For example: if a job failed twice and then completed the Job.processCount property would report a value of 3.

See the Job Repeat document for more detail on repeating jobs.

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally