예제 #1
0
파일: Job.php 프로젝트: shonm/php-resque
 /**
  * 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 프로젝트: shonm/php-resque
 /**
  * Get a statistic belonging to this worker.
  *
  * @param  string $stat Statistic to fetch.
  * @return int    Statistic value.
  */
 public function getStat($stat)
 {
     return Stat::get($stat . ':' . (string) $this);
 }