示例#1
0
 /**
  * Mark the current job as having failed.
  *
  * @param $exception
  */
 public function fail($exception)
 {
     Resque_Event::trigger('onFailure', array('exception' => $exception, 'job' => $this));
     $this->updateStatus(Resque_Job_Status::STATUS_FAILED);
     Resque_Failure::create($this->payload, $exception, $this->worker, $this->queue);
     Resque_Stat::incr('failed');
     Resque_Stat::incr('failed:' . $this->worker);
 }
 /**
  * Mark the current job as having failed.
  *
  * @param $exception
  */
 public function fail($exception)
 {
     Resque_Event::trigger('onFailure', array('exception' => $exception, 'job' => $this));
     // job的状态更新成failed
     $this->updateStatus(Resque_Job_Status::STATUS_FAILED);
     require_once dirname(__FILE__) . '/Failure.php';
     // 记录信息到failed队列中
     Resque_Failure::create($this->payload, $exception, $this->worker, $this->queue);
     // 失败状态的个数+1
     Resque_Stat::incr('failed');
     Resque_Stat::incr('failed:' . $this->worker);
 }
示例#3
0
文件: Job.php 项目: hungnv0789/vhtm
	/**
	 * Mark the current job as having failed.
	 */
	public function fail($exception)
	{
		$this->updateStatus(Resque_Job_Status::STATUS_FAILED);
		require_once dirname(__FILE__).'/Failure.php';
		Resque_Failure::create(
			$this->payload,
			$exception,
			$this->worker,
			$this->queue
		);
	}