Skip to content

Job.getCleanCopy

Grant Carthew edited this page Aug 17, 2016 · 11 revisions

Method Signature

Job.getCleanCopy()

Parameter: None.

Returns: A JavaScript Object populated with the properties of the job.

Example:

let jobData = job.getCleanCopy()

This method is mostly used within the rethinkdb-job-queue to save the jobs to the database. You can use this method if you want a copy of the job properties.

The returned job object has all methods and the reference to the owning Queue removed leaving only the jobs properties. The Job.priority value will be converted to an integer rather than the string used within your code.

const Queue = require('rethinkdb-job-queue')
const queue = new Queue(options)

const job = queue.createJob({ job:data })
const cleanCopy = job.cleanCopy

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally