From 28944e28fce168860137e531221a214282fc8761 Mon Sep 17 00:00:00 2001 From: Nuno Pereira Date: Thu, 8 Aug 2024 14:29:38 +0100 Subject: [PATCH] fix: add exit() when disconnected --- arena/arena_mqtt.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arena/arena_mqtt.py b/arena/arena_mqtt.py index 5300fd24..cbb28fa2 100644 --- a/arena/arena_mqtt.py +++ b/arena/arena_mqtt.py @@ -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 @@ -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: