Skip to content

Commit

Permalink
Merge pull request #3 from mariansoban/bug/reconnect-fix
Browse files Browse the repository at this point in the history
Merge mariansoban changes
  • Loading branch information
void-spark authored May 17, 2020
2 parents 272fcd0 + 1b6978f commit 9562c84
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion service.mqtt/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,10 @@ def connecthandler(mqc,userdata,flags,rc):
def disconnecthandler(mqc,userdata,rc):
mqttlogging("MQTT: Disconnected from MQTT broker with rc=%d" % (rc))
time.sleep(5)
mqc.reconnect()
try:
mqc.reconnect()
except Exception as e:
mqttlogging("MQTT: Error while reconnectig: message %s: %s" % (type(e).__name__,e))

#
# Starts connection to the MQTT broker, sets the will
Expand Down

0 comments on commit 9562c84

Please sign in to comment.