Skip to content

Commit

Permalink
fix: fix issue with runtime cancellation prior to MQTT publish (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
bachya authored May 13, 2024
1 parent d95a649 commit 156b49e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ecowitt2mqtt/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ async def async_start(self) -> None:
"""Start the runtime."""
LOGGER.debug("Starting runtime")
self._rest_api_server_task = asyncio.create_task(self._uvicorn.serve())
await self._rest_api_server_task
try:
await self._rest_api_server_task
except asyncio.CancelledError:
LOGGER.debug("Runtime task successfully cancelled")

def stop(self) -> None:
"""Stop the REST API server."""
Expand Down

0 comments on commit 156b49e

Please sign in to comment.