From 77509cb40effb8475621032b027bfe6d474f92f6 Mon Sep 17 00:00:00 2001 From: root <165865819+brianshea2@users.noreply.github.com> Date: Sun, 1 Dec 2024 03:05:50 +0000 Subject: [PATCH] remove unnecessary unsubscribe before disconnect --- internal/meshtastic/mqtt.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/meshtastic/mqtt.go b/internal/meshtastic/mqtt.go index f6020a6..2c783f4 100644 --- a/internal/meshtastic/mqtt.go +++ b/internal/meshtastic/mqtt.go @@ -36,7 +36,6 @@ type MQTTClient struct { Accept func(from uint32) bool BlockCipher cipher.Block MessageHandler func(from uint32, topic string, portNum generated.PortNum, payload []byte) - topics []string mqtt.Client } @@ -68,16 +67,12 @@ func (c *MQTTClient) Connect() error { return err } log.Printf("[info] subscribed to %v", topic) - c.topics = append(c.topics, topic) } return nil } func (c *MQTTClient) Disconnect() { if c.IsConnected() { - if c.Unsubscribe(c.topics...).WaitTimeout(time.Second) { - log.Print("[info] unsubscribed") - } c.Client.Disconnect(1000) } }