mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-10 01:17:42 +01:00
cancelling also mqtt listening on cacnellederror
This commit is contained in:
parent
3768a77dfe
commit
b0406a4de8
2 changed files with 6 additions and 2 deletions
|
@ -1,3 +1,3 @@
|
||||||
__version__ = "4.1.7.a13"
|
__version__ = "4.1.7.a14"
|
||||||
__codename__ = "Groundhog Day"
|
__codename__ = "Groundhog Day"
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,10 @@ class SatelliteController:
|
||||||
method = topic_filter[1]
|
method = topic_filter[1]
|
||||||
if message.topic.matches(topic):
|
if message.topic.matches(topic):
|
||||||
await (method(message))
|
await (method(message))
|
||||||
|
except asyncio.CancelledError:
|
||||||
|
# Cancel
|
||||||
|
self.logger.warning("MQTT Listening Cancelled")
|
||||||
|
break
|
||||||
except MqttError as e:
|
except MqttError as e:
|
||||||
self.logger.error("MQTT Exception: {}".format(e))
|
self.logger.error("MQTT Exception: {}".format(e))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -164,7 +168,7 @@ class SatelliteController:
|
||||||
await method(message.payload.decode())
|
await method(message.payload.decode())
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
# Cancel
|
# Cancel
|
||||||
self.logger.warning("Sub Cancelled")
|
self.logger.warning("Subscription {} Cancelled".format(topic))
|
||||||
self.error=True
|
self.error=True
|
||||||
except MqttError as e:
|
except MqttError as e:
|
||||||
self.logger.error("Sub MQTT Exception: {}".format(e))
|
self.logger.error("Sub MQTT Exception: {}".format(e))
|
||||||
|
|
Loading…
Reference in a new issue