This commit is contained in:
Matthew R Kasun
2022-01-27 15:52:31 -05:00
parent 84d9faeb3f
commit 4854cb2db9
2 changed files with 3 additions and 2 deletions

View File

@@ -75,7 +75,7 @@ func SetupMQTT(cfg *config.ClientConfig) mqtt.Client {
for {
if token := client.Connect(); token.Wait() && token.Error() != nil {
logger.Log(2, "unable to connect to broker, retrying ...")
if time.Now().Afer(tperiod) {
if time.Now().After(tperiod) {
log.Fatal(0, "could not connect to broker, exiting ...", token.Error())
}
} else {