diff mqtt_io.py @ 27:32cfefe3155b

try harder to crash if there's an mqtt error, so k8s does a full restart
author drewp@bigasterisk.com
date Sat, 23 Mar 2024 15:25:02 -0700
parents e3dbd04dab96
children
line wrap: on
line diff
--- a/mqtt_io.py	Sat Feb 03 20:56:27 2024 -0800
+++ b/mqtt_io.py	Sat Mar 23 15:25:02 2024 -0700
@@ -2,6 +2,7 @@
 import inspect
 import json
 import logging
+import os
 import time
 from typing import Callable, cast
 import weakref
@@ -109,6 +110,7 @@
         except aiomqtt.MqttError as e:
             MQTT_CONNECTED.set(0)
             log.error(e, exc_info=True)
+            os.abort()
 
     async def _connectAndRead(self):
         async with self.client: