Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9dd4eed

Browse files
committed
Tweak retries
1 parent 62f32d8 commit 9dd4eed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Jobs/AsyncJob.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function fire()
4646

4747
// Mark job as started
4848
$this->job->status = Job::STATUS_STARTED;
49+
$this->job->retries++;
4950
$this->job->save();
5051

5152
// Fire the actual job
@@ -78,7 +79,6 @@ public function release($delay = 0)
7879
{
7980
// Update the Job status
8081
$this->job->status = Job::STATUS_OPEN;
81-
$this->job->retries++;
8282
$this->job->save();
8383

8484
// Wait for the delay
@@ -97,7 +97,7 @@ public function release($delay = 0)
9797
*/
9898
public function attempts()
9999
{
100-
return (int) $this->job->retries + 1;
100+
return (int) $this->job->retries;
101101
}
102102

103103
/**

0 commit comments

Comments
 (0)