Skip to content

Job Schema

Grant Carthew edited this page Sep 21, 2016 · 14 revisions

Description

For reference purposes this document shows the schema of a job as it is saved in the RethinkDB database.

Below is a JSON representation of a job in the queue. This job contains valid data although it does not have any log entries.

Note: The example here is describing the job schema only, not your own data for job processing. You can populate your jobs with any properties you like.

{
  dateCreated: 2016-09-19T03:07:44.394Z,
  dateEnable: 2016-09-19T03:12:44.451Z,
  dateFinished: 2016-09-19T03:07:44.469Z,
  dateStarted: 2016-09-19T03:07:44.451Z,
  id: '5127d082-fe7e-4e88-b1de-7093029695c3',
  log: []
  priority: 'normal',
  progress: 0,
  queueId: 'WebDev::rjqJobQueueTestJobs:1942:ebc89e54-f7d3-40a1-952a-3bb152d154ce',
  retryCount: 0,
  retryDelay: 600000,
  retryMax: 3,
  status: 'completed',
  timeout: 300000
}

Following is a breakdown of all of the job properties and a brief description of what they are used for.

  • dateCreated: The date is added when the job is created and should never change.
  • dateEnable: Jobs will not be processed until the current date is past this date.
  • dateFinished: Records the date when a job completes, fails, gets cancelled, or is terminated.
  • dateStarted: The date the job processing was last started. It may be a retry start date.
  • id: The document id within the RethinkDB database.
  • log: An array of log entries created from within the Queue object or by using Job.createLog and Job.addLog.
  • priority: A number representing the processing order of the jobs.
  • progress: The user reported progress for the job. Updated with Job.setProgress.
  • queueId: A string representing the Queue object that last updated the job in the database.
  • retryCount: A record of the number of retry attempts the job has had.
  • retryDelay: The time delay in milliseconds before failed jobs will be retried.
  • retryMax: The maximum number of retries before the job is terminated.
  • status: The current status of the job.
  • timeout: How long the job can be processed for before it is considered failed.

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally