コード例 #1
0
ファイル: Job.php プロジェクト: huang-sh/yaf.app
 /**
  * Mark the current job as having failed.
  *
  * @param $exception
  */
 public function fail($exception)
 {
     Event::trigger('onFailure', array('exception' => $exception, 'job' => $this));
     $this->updateStatus(Status::STATUS_FAILED);
     Failure::create($this->payload, $exception, $this->worker, $this->queue);
     Stat::incr('failed');
     Stat::incr('failed:' . $this->worker);
 }
コード例 #2
0
ファイル: Worker.php プロジェクト: junthink/resque
 /**
  * Notify Redis that we've finished working on a job, clearing the working
  * state and incrementing the job stats.
  */
 public function doneWorking()
 {
     $this->currentJob = null;
     Stat::incr('processed');
     Stat::incr('processed:' . (string) $this);
     Resque::redis()->del('worker:' . (string) $this);
 }