src/Contracts/BaseJob.php
protected function failed()
    {
        $retryCount = $this->model->getTriedCount() + 1;

        if ($retryCount >= $this->getMaxRetryCount()) {
            $this->model->setStatus(JobsConst::JOB_STATUS_FAILED);
        } else {
            $this->model->setStatus(JobsConst::JOB_STATUS_WAITING_RETRY);
            $this->model->setTryAt($this->getNextTryTime());
        }
        $this->model->setTriedCount($retryCount);

        return $this->model->persist();
    }
protected function failed()
    {
        $retryCount = $this->model->getTriedCount() + 1;

        if ($retryCount >= $this->getMaxRetryCount()) {
            $this->model->setStatus(JobsConst::JOB_STATUS_FAILED);
        } else {
            $this->model->setStatus(JobsConst::JOB_STATUS_WAITING_RETRY);
            $this->model->setTryAt($this->getNextTryTime());
        }
        $this->model->setTriedCount($retryCount);

        return $this->model->persist();
    }
protected function failed ( ) { $ retryCount = $ this -> model -> getTriedCount ( ) + 1 ; if ( $ retryCount >= $ this -> getMaxRetryCount ( ) ) { $ this -> model -> setStatus ( JobsConst :: JOB_STATUS_FAILED ) ; } else { $ this -> model -> setStatus ( JobsConst :: JOB_STATUS_WAITING_RETRY ) ; $ this -> model -> setTryAt ( $ this -> getNextTryTime ( ) ) ; } $ this -> model -> setTriedCount ( $ retryCount ) ; return $ this -> model -> persist ( ) ; }
After failed we need to update tried count
and check whether the tried count have reached to max retry count
After failed we need to update tried count and check whether the tried count have reached to max retry count