File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/VladimirYuldashev/LaravelQueueRabbitMQ/Queue/Jobs Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 77use Illuminate \Contracts \Queue \Job as JobContract ;
88use Illuminate \Database \DetectsDeadlocks ;
99use Illuminate \Queue \Jobs \Job ;
10+ use Illuminate \Support \Str ;
1011use PhpAmqpLib \Channel \AMQPChannel ;
1112use PhpAmqpLib \Message \AMQPMessage ;
1213use VladimirYuldashev \LaravelQueueRabbitMQ \Queue \RabbitMQQueue ;
@@ -113,7 +114,10 @@ public function release($delay = 0)
113114 try {
114115 $ job = unserialize ($ body ['data ' ]['command ' ]);
115116 } catch (Exception $ exception ) {
116- if ($ this ->causedByDeadlock ($ exception )) {
117+ if (
118+ $ this ->causedByDeadlock ($ exception ) ||
119+ Str::contains ($ exception ->getMessage (), ['detected deadlock ' ])
120+ ) {
117121 sleep (2 );
118122 $ this ->release ($ delay );
119123 return ;
You can’t perform that action at this time.
0 commit comments