zqwang 2 lat temu
rodzic
commit
c9be091076
1 zmienionych plików z 15 dodań i 1 usunięć
  1. 15 1
      app/Modules/User/Services/UserService.php

+ 15 - 1
app/Modules/User/Services/UserService.php

@@ -70,7 +70,12 @@ class UserService
 
         if($status == 1){
             // myLog('incrAddDeskTop')->info('qappAddDesktopTask', compact('uid', 'status'));
+            $start  = time();
             UserTaskService::addUserTaskQueue($uid, BaseTask::add_desk, UserTaskService::add_trigger);
+            $time = time() - $start;
+            if ($time >= 1 ){
+                sendNotice("加桌队列-mq-投递超过1耗时".$time);
+            }
         }
 
         if (!$log) {
@@ -78,9 +83,13 @@ class UserService
             if($status == 1){
                 // 加桌统计
 //                QappAddDeskTopService::incrAddDeskTop($uid, QuickConst::FIELD_ADD_DESKTOP);
-
+                $start  = time();
                 $job = new UserAddDeskJob($uid);
                 dispatch($job)->onConnection('rabbitmq')->onQueue('qapp_user_add_desk')->delay(now()->addMinutes(3));
+                $time = time() - $start;
+                if ($time >= 1 ){
+                    sendNotice("加桌队列-mq-投递超过1耗时".$time);
+                }
             }
             //第一次加桌 没有任何记录,加桌状态为0
             if($status == 0){
@@ -98,7 +107,12 @@ class UserService
 //                QappAddDeskTopService::incrAddDeskTop($uid, QuickConst::FIELD_ADD_DESKTOP);
 
                 $job = new UserAddDeskJob($uid);
+                $start = time();
                 dispatch($job)->onConnection('rabbitmq')->onQueue('qapp_user_add_desk')->delay(now()->addMinutes(3));
+                $time = time() - $start;
+                if ($time >= 1 ){
+                    sendNotice("加桌队列-mq-投递超过1耗时".$time);
+                }
                 return false;
             }