From 4ea67a7836aa9b8b1352be76050d46c0d9cc64bb Mon Sep 17 00:00:00 2001 From: kanade <3136520963@qq.com> Date: Tue, 20 Jul 2021 14:41:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=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 442f6da..9a1de46 100644 --- a/rabbitmq.go +++ b/rabbitmq.go @@ -31,6 +31,7 @@ func (r *rabbitmq) Publish(exchangeName, msg string, delay ...int64) error { if err != nil { return err } + defer ch.Close() header := amqp.Table{} if len(delay) > 0 && delay[0] > 0 { header["x-delay"] = delay[0] * 1000