Skip to content

Commit

Permalink
fix: add exit() when disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
nampereira committed Aug 8, 2024
1 parent ca9b71a commit 28944e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arena/arena_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def on_connect(self, client, userdata, flags, rc):

else:
print(f"Connection error! Result code={rc}")
os._exit(1)

def on_message(self, client, userdata, msg):
# ignore own messages
Expand All @@ -281,6 +282,8 @@ def on_disconnect(self, client, userdata, rc):
else:
print(f"Disconnected! Result code={rc}.")

os._exit(rc)

def disconnect(self):
"""Disconnects Paho MQTT client"""
if self.end_program_callback:
Expand Down

0 comments on commit 28944e2

Please # to comment.