From 04c6cf3f418ae2205250865f2be42fdd543aef32 Mon Sep 17 00:00:00 2001 From: lTimej Date: Fri, 5 Jul 2024 10:45:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=B3=BB=E7=BB=9F=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E7=8A=B6=E6=80=81=E8=87=AA=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E6=94=AF=E6=8C=81=20#7457?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcloud/contrib/monitor/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcloud/contrib/monitor/views.py b/gcloud/contrib/monitor/views.py index 5a253e1c8..90755dd96 100644 --- a/gcloud/contrib/monitor/views.py +++ b/gcloud/contrib/monitor/views.py @@ -179,5 +179,6 @@ def get_mq_data(request): 获取mq数据 """ cl = pyrabbit2.Client("localhost:15672", "guest", "guest") - data = {vhost: [{"vhost": vhost, "queue_name": queue["name"], "message_count": queue["messages"], "queue_state": queue["state"], "messages": cl.get_messages(vhost, queue["name"], count=queue["messages"], requeue=True)} for queue in cl.get_queues(vhost=vhost)] for vhost in cl.get_vhost_names()} + data = { + vhost: [{"vhost": vhost, "queue_name": queue["name"], "message_count": queue["messages"], "queue_state": queue["state"], "messages": cl.get_messages(vhost, queue["name"], count=queue["messages"], requeue=True)} for queue in cl.get_queues(vhost=vhost)] for vhost in cl.get_vhost_names()} return JsonResponse({"result": True, "data": data})