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