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.
2 parents af6b1a8 + cc7d46f commit e501804Copy full SHA for e501804
src/VladimirYuldashev/LaravelQueueRabbitMQ/Queue/Jobs/RabbitMQJob.php
@@ -111,8 +111,12 @@ public function release($delay = 0)
111
public function attempts()
112
{
113
$body = json_decode($this->message->body, true);
114
-
115
- return isset($body['data']['attempts']) ? (int)$body['data']['attempts'] : 0;
+ $job = unserialize($body['data']['command']);
+ if (is_object($job) && property_exists($job, 'attempts'))
116
+ {
117
+ return (int) $job->attempts;
118
+ }
119
+ return 0;
120
}
121
122
/**
0 commit comments