Skip to content

Commit

Permalink
Enable keepalive in MQTT connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrin committed Jan 6, 2022
1 parent 11973fc commit a8e059a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sender/mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func SetupMQTT(conf config.MQTT) {
opts.SetClientID(conf.ClientID)
opts.SetUsername(conf.Username)
opts.SetPassword(conf.Password)
opts.SetKeepAlive(10 * time.Second)
opts.SetAutoReconnect(true)
opts.SetMaxReconnectInterval(10 * time.Second)
mqttClient = mqtt.NewClient(opts)
Expand Down

0 comments on commit a8e059a

Please sign in to comment.