We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa95155 commit cc7d46fCopy full SHA for cc7d46f
src/VladimirYuldashev/LaravelQueueRabbitMQ/Queue/Jobs/RabbitMQJob.php
@@ -93,7 +93,6 @@ public function release($delay = 0)
93
94
// write attempts to job
95
$job->attempts = $attempts + 1;
96
- $body['data']['attempts'] = $attempts + 1;
97
98
$data = $body['data'];
99
@@ -112,8 +111,12 @@ public function release($delay = 0)
112
111
public function attempts()
113
{
114
$body = json_decode($this->message->body, true);
115
-
116
- return isset($body['data']['attempts']) ? (int)$body['data']['attempts'] : 0;
+ $job = unserialize($body['data']['command']);
+ if (is_object($job) && property_exists($job, 'attempts'))
+ {
117
+ return (int) $job->attempts;
118
+ }
119
+ return 0;
120
}
121
122
/**
0 commit comments