コード例 #1
0
 public function testGetStatByName()
 {
     Stat::incr('test_get', 100);
     $this->assertEquals(100, Stat::get('test_get'));
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
ファイル: Job.php プロジェクト: craryprimitiveman/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);
 }