From f028a66a9d4f4538b14a0a10649c3fcdbc336e01 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 15 Jun 2022 14:45:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rabbitmq.go | 1 + 1 file changed, 1 insertion(+) diff --git a/rabbitmq.go b/rabbitmq.go index 922866d..382aa90 100644 --- a/rabbitmq.go +++ b/rabbitmq.go @@ -52,6 +52,7 @@ func (r *rabbitmq) Consume(queueName string, autoAck bool, callback func(amqp.De if err != nil { return err } + defer ch.Close() //消费队列 msgs, err := ch.Consume( queueName, //队列名称