lib/workflow-in-memory-backend.js
function queueJob(job, callback) {
            if (!jobs[job.uuid]) {
                return callback(new e.BackendResourceNotFoundError(sprintf(
                  'Job with uuid \'%s\' does not exist', job.uuid)));
            } else if (jobs[job.uuid].execution !== 'running') {
                return callback(new e.BackendPreconditionFailedError(
                  'Only running jobs can be queued again'));
            } else {
                job.runner_id = null;
                job.execution = 'queued';
                jobs[job.uuid] = clone(job);
                queued_jobs.push(job.uuid);
                return callback(null, job);
            }
        }
function queueJob(job, callback) {
            if (!jobs[job.uuid]) {
                return callback(new e.BackendResourceNotFoundError(sprintf(
                  'Job with uuid \'%s\' does not exist', job.uuid)));
            } else if (jobs[job.uuid].execution !== 'running') {
                return callback(new e.BackendPreconditionFailedError(
                  'Only running jobs can be queued again'));
            } else {
                job.runner_id = null;
                job.execution = 'queued';
                jobs[job.uuid] = clone(job);
                queued_jobs.push(job.uuid);
                return callback(null, job);
            }
        }
function queueJob ( job , callback ) { if ( ! jobs [ job . uuid ] ) { return callback ( new e . BackendResourceNotFoundError ( sprintf ( 'Job with uuid \'%s\' does not exist' , job . uuid ) ) ) ; } else if ( jobs [ job . uuid ] . execution !== 'running' ) { return callback ( new e . BackendPreconditionFailedError ( 'Only running jobs can be queued again' ) ) ; } else { job . runner_id = null ; job . execution = 'queued' ; jobs [ job . uuid ] = clone ( job ) ; queued_jobs . push ( job . uuid ) ; return callback ( null , job ) ; } }
Queue a job which has been running; i.e, due to whatever the reason, re-queue the job. It'll unlock the job, update the status, add the results for every finished task so far ... job - the job Object. It'll be saved to the backend with the provided properties to ensure job status persistence. callback - f(err, job) callback will be called with error if something fails, otherwise it'll return the updated job using getJob.
Queue a job which has been running ; i . e due to whatever the reason re - queue the job . It ll unlock the job update the status add the results for every finished task so far ... job - the job Object . It ll be saved to the backend with the provided properties to ensure job status persistence . callback - f ( err job ) callback will be called with error if something fails otherwise it ll return the updated job using getJob .