Skip to content

Commit 9ba1aa2

Browse files
Fix attempts and tries count. (Rewrite later)
1 parent 2b20750 commit 9ba1aa2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/VladimirYuldashev/LaravelQueueRabbitMQ/Queue/Jobs/RabbitMQJob.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ public function fire()
4848
*/
4949
public function getRawBody()
5050
{
51-
return $this->message->body;
51+
$body = $this->message->body;
52+
53+
unset($body['data']['attempts']);
54+
55+
return $body;
5256
}
5357

5458
/**
@@ -111,7 +115,7 @@ public function attempts()
111115
{
112116
$body = json_decode($this->message->body, true);
113117

114-
return isset($body['data']['attempts']) ? (int)$body['data']['attempts'] : 0;
118+
return isset($body['data']['attempts']) ? (int)$body['data']['attempts'] : 1;
115119
}
116120

117121
/**

0 commit comments

Comments
 (0)