Ejemplo n.º 1
0
 public function testGetStatByName()
 {
     Stat::incr('test_get', 100);
     $this->assertEquals(100, Stat::get('test_get'));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 /**
  * 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);
 }