Update the status of the current job.
public updateStatus ( integer $status ) | ||
$status | integer | Status constant from Resque_Job_Status indicating the current status of a job. |
/** * Tell Redis which job we're currently working on. * * @param object $job Resque_Job instance containing the job we're working on. */ public function workingOn(Resque_Job $job) { $job->worker = $this; $this->currentJob = $job; $job->updateStatus(Resque_Job_Status::STATUS_RUNNING); $data = json_encode(array('queue' => $job->queue, 'run_at' => strftime('%a %b %d %H:%M:%S %Z %Y'), 'payload' => $job->payload)); Resque::redis()->set('worker:' . $job->worker, $data); }