mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-23 15:38:14 +01:00
additional logging in mqttsensor task cancel
This commit is contained in:
parent
6e066282c4
commit
62298ae844
2 changed files with 9 additions and 6 deletions
|
@ -1,3 +1,3 @@
|
|||
__version__ = "4.1.7.a10"
|
||||
__version__ = "4.1.7.a11"
|
||||
__codename__ = "Groundhog Day"
|
||||
|
||||
|
|
|
@ -126,11 +126,14 @@ class MQTTSensor(CBPiSensor):
|
|||
return dict(value=self.value)
|
||||
|
||||
async def on_stop(self):
|
||||
if self.mqtt_task.done() is False:
|
||||
if not self.mqtt_task.done():
|
||||
logging.warning("Task not done -> cancelling")
|
||||
self.mqtt_task.cancel()
|
||||
try:
|
||||
logging.warning("trying to call cancelled task")
|
||||
await self.mqtt_task
|
||||
except asyncio.CancelledError:
|
||||
logging.warning("Task has been Cancelled")
|
||||
pass
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue