1515
1616class RabbitMQJob extends Job implements JobContract
1717{
18-
1918 use DetectsDeadlocks;
2019
2120 /**
@@ -31,20 +30,19 @@ class RabbitMQJob extends Job implements JobContract
3130 /**
3231 * Creates a new instance of RabbitMQJob.
3332 *
34- * @param \Illuminate\Container\Container $container
33+ * @param \Illuminate\Container\Container $container
3534 * @param \VladimirYuldashev\LaravelQueueRabbitMQ\Queue\RabbitMQQueue $connection
36- * @param \PhpAmqpLib\Channel\AMQPChannel $channel
37- * @param string $queue
38- * @param \PhpAmqpLib\Message\AMQPMessage $message
35+ * @param \PhpAmqpLib\Channel\AMQPChannel $channel
36+ * @param string $queue
37+ * @param \PhpAmqpLib\Message\AMQPMessage $message
3938 */
4039 public function __construct (
4140 Container $ container ,
4241 RabbitMQQueue $ connection ,
4342 AMQPChannel $ channel ,
4443 $ queue ,
4544 AMQPMessage $ message
46- )
47- {
45+ ) {
4846 $ this ->container = $ container ;
4947 $ this ->connection = $ connection ;
5048 $ this ->channel = $ channel ;
@@ -54,8 +52,10 @@ public function __construct(
5452
5553 /**
5654 * Fire the job.
57- * @return void
55+ *
5856 * @throws Exception
57+ *
58+ * @return void
5959 */
6060 public function fire ()
6161 {
@@ -74,6 +74,7 @@ public function fire()
7474 ) {
7575 sleep (2 );
7676 $ this ->fire ();
77+
7778 return ;
7879 }
7980
@@ -125,8 +126,10 @@ public function delete()
125126 * Release the job back into the queue.
126127 *
127128 * @param int $delay
128- * @return void
129+ *
129130 * @throws Exception
131+ *
132+ * @return void
130133 */
131134 public function release ($ delay = 0 )
132135 {
@@ -190,11 +193,13 @@ public function setJobId($id)
190193 }
191194
192195 /**
193- * Unserialize job
196+ * Unserialize job.
194197 *
195198 * @param array $body
196- * @return mixed
199+ *
197200 * @throws Exception
201+ *
202+ * @return mixed
198203 */
199204 private function unserialize (array $ body )
200205 {
@@ -206,11 +211,11 @@ private function unserialize(array $body)
206211 Str::contains ($ exception ->getMessage (), ['detected deadlock ' ])
207212 ) {
208213 sleep (2 );
214+
209215 return $ this ->unserialize ($ body );
210216 }
211217
212218 throw $ exception ;
213219 }
214220 }
215-
216221}
0 commit comments