Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Added attempts() method to FakeJob #51951

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/Illuminate/Queue/Jobs/FakeJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ class FakeJob extends Job
*/
public $releaseDelay;

/**
* The number of attempts made to process the job.
*
* @var int
*/
public $attempts = 1;

/**
* The exception the job failed with.
*
Expand Down Expand Up @@ -52,6 +59,16 @@ public function release($delay = 0)
$this->releaseDelay = $delay;
}

/**
* Get the number of times the job has been attempted.
*
* @return int
*/
public function attempts()
{
return $this->attempts;
}

/**
* Delete the job from the queue.
*
Expand Down