I use laravel queue and while job failed it will retry, Can it not retry?
Yes.
how to do...
how to make laravel queue not retry ?
/**
* Mark the given job as failed if it has exceeded the maximum allowed attempts.
*
* This will likely be because the job previously exceeded a timeout.
*
* @param string $connectionName
* @param \Illuminate\Contracts\Queue\Job $job
* @param int $maxTries
* @return void
*/
protected function markJobAsFailedIfAlreadyExceedsMaxAttempts($connectionName, $job, $maxTries)
{
if ($maxTries === 0 || $job->attempts() <= $maxTries) {
return;
}
$e = new MaxAttemptsExceededException(
'A queued job has been attempted too many times. The job may have previously timed out.'
);
$this->failJob($connectionName, $job, $e);
throw $e;
}
if ($maxTries === 0 || $job->attempts() <= $maxTries)
means neither 0 nor 1 for --tries param can do that.