From 77c901e4d93fc0e578565cdb33c98d33e672bf1f Mon Sep 17 00:00:00 2001 From: Abhishek Kondur Date: Wed, 5 Oct 2022 19:48:55 +0530 Subject: [PATCH] fix for node connect/disconnect issue --- netclient/functions/daemon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netclient/functions/daemon.go b/netclient/functions/daemon.go index d3a1c99f..afcf70fd 100644 --- a/netclient/functions/daemon.go +++ b/netclient/functions/daemon.go @@ -239,7 +239,7 @@ func setupMQTTSingleton(cfg *config.ClientConfig) error { opts.AddBroker("mqtts://" + server + ":" + port) opts.SetUsername(cfg.Node.ID) opts.SetPassword(string(pass)) - mqclient := mqtt.NewClient(opts) + mqclient = mqtt.NewClient(opts) var connecterr error opts.SetClientID(ncutils.MakeRandomString(23)) if token := mqclient.Connect(); !token.WaitTimeout(30*time.Second) || token.Error() != nil {