shish 8 сар өмнө
parent
commit
cf311420cf

+ 0 - 2
common/components/rabbitmq/customConsumer.php

@@ -34,7 +34,6 @@ class customConsumer implements ConsumerInterface
                 return ConsumerInterface::MSG_REJECT;
             }
             print_r($data);
-            Yii::$app->db->open();//处理消息前确保连接可用
             // 根据操作类型分发处理
             $type = $data['type'] ?? null;
             switch ($type) {
@@ -49,7 +48,6 @@ class customConsumer implements ConsumerInterface
                     noticeUtil::push("客户的消费者报错,不存在的类型: {$type}");
                     $result = false;
             }
-            Yii::$app->db->close(); // 处理完后关闭连接
             if ($result) {
                 return ConsumerInterface::MSG_ACK;
             } else {

+ 0 - 2
common/components/rabbitmq/notifyConsumer.php

@@ -39,7 +39,6 @@ class notifyConsumer implements ConsumerInterface
                 return ConsumerInterface::MSG_REJECT;
             }
             print_r($data);
-            Yii::$app->db->open();//处理消息前确保连接可用
             // 根据通知类型分发处理
             $type = $data['type'] ?? null;
             switch ($type) {
@@ -59,7 +58,6 @@ class notifyConsumer implements ConsumerInterface
                     noticeUtil::push("通知的消费者提示:Unknown notify type: {$type}", '15280215347');
                     $result = false;
             }
-            Yii::$app->db->close(); // 处理完后关闭连接
             if ($result) {
                 return ConsumerInterface::MSG_ACK;
             } else {

+ 0 - 2
common/components/rabbitmq/stockConsumer.php

@@ -33,7 +33,6 @@ class stockConsumer implements ConsumerInterface
                 return ConsumerInterface::MSG_REJECT;
             }
             print_r($data);
-            Yii::$app->db->open();//处理消息前确保连接可用
             // 根据操作类型分发处理
             $type = $data['type'] ?? null;
             switch ($type) {
@@ -44,7 +43,6 @@ class stockConsumer implements ConsumerInterface
                     noticeUtil::push("库存的消费者报错,未知 type: {$type}");
                     $result = false;
             }
-            Yii::$app->db->close(); // 处理完后关闭连接
             if ($result) {
                 return ConsumerInterface::MSG_ACK;
             } else {