Browse Source

add queue name in Exception

visuddhinanda 1 year ago
parent
commit
c6ab50f43f
1 changed files with 4 additions and 3 deletions
  1. 4 3
      api-v8/app/Http/Api/Mq.php

+ 4 - 3
api-v8/app/Http/Api/Mq.php

@@ -133,7 +133,8 @@ class Mq
                         throw new \Exception('task error');
                         throw new \Exception('task error');
                     }
                     }
                 } catch (\Exception $e) {
                 } catch (\Exception $e) {
-                    Log::error('mq worker exception', [
+                    Log::error("mq worker {$queue} exception", [
+                        'queue' => $queue,
                         'message_id' => $message->get('message_id'),
                         'message_id' => $message->get('message_id'),
                         'exception' => $e
                         'exception' => $e
                     ]);
                     ]);
@@ -215,8 +216,8 @@ class Mq
             try {
             try {
                 $channel->wait(null, false, $timeout);
                 $channel->wait(null, false, $timeout);
             } catch (AMQPTimeoutException $e) {
             } catch (AMQPTimeoutException $e) {
-		    // ignore it
-	    }
+                // ignore it
+            }
         }
         }
     }
     }
 }
 }