mqtt sleeps before reconnect

This commit is contained in:
Paolo Asperti 2022-06-03 16:07:50 +02:00
parent e5bcea3ec3
commit 7e06223142
Signed by: paspo
GPG Key ID: 06D46905D19D5182

View File

@ -57,6 +57,7 @@ func Setup() {
syslog.Err("mqtt connection lost error: " + err.Error()) syslog.Err("mqtt connection lost error: " + err.Error())
}) })
opts.SetReconnectingHandler(func(c MQTT.Client, options *MQTT.ClientOptions) { opts.SetReconnectingHandler(func(c MQTT.Client, options *MQTT.ClientOptions) {
time.Sleep(5 * time.Second)
syslog.Notice("mqtt reconnecting") syslog.Notice("mqtt reconnecting")
}) })
opts.SetOnConnectHandler(func(c MQTT.Client) { opts.SetOnConnectHandler(func(c MQTT.Client) {