From 80b523840df4fe2c95883868f2430606d9cf169c Mon Sep 17 00:00:00 2001 From: subsan Date: Wed, 15 Mar 2023 10:10:20 +0200 Subject: [PATCH] fix reconnect function --- pkg/connector/listener.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/connector/listener.go b/pkg/connector/listener.go index 5c0eb3c..bbbd35f 100644 --- a/pkg/connector/listener.go +++ b/pkg/connector/listener.go @@ -42,6 +42,8 @@ func disconnect() { } func reconnect() { + disconnect() + for !isConnected { time.Sleep(config.Config.Timeout.Reconnect) log.Printf(" [ ] [connector] try reconnect")