From dae28c7ba88c0a944c65b101e399ad910b9de0f8 Mon Sep 17 00:00:00 2001 From: lucas Date: Mon, 9 Jun 2025 16:14:54 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbOperate/mqttHelper.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dbOperate/mqttHelper.go b/dbOperate/mqttHelper.go index c720995..d298ca0 100644 --- a/dbOperate/mqttHelper.go +++ b/dbOperate/mqttHelper.go @@ -43,8 +43,7 @@ reConn: opts.SetUsername(the.UserName) opts.SetPassword(the.Password) opts.SetClientID(the.ClientId) - opts.SetCleanSession(false) // 通常需要关闭 CleanSession - opts.SetResumeSubs(true) // 启用 ResumeSubs + opts.SetCleanSession(true) // 通常需要关闭 CleanSession opts.SetOnConnectHandler(the.reConn2Subscribe) opts.SetMaxReconnectInterval(10 * time.Second) if sslEnable {