From 5c130ecc1028112cd179007e79e71a8b9e5c16b8 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 4 Sep 2024 12:08:55 +0200 Subject: [PATCH] Check if setup task is actually still running (#874) --- matter_server/server/device_controller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/matter_server/server/device_controller.py b/matter_server/server/device_controller.py index bfe57795..0948f696 100644 --- a/matter_server/server/device_controller.py +++ b/matter_server/server/device_controller.py @@ -1424,6 +1424,7 @@ def _setup_node_create_task(self, node_id: int) -> asyncio.Task | None: node_logger.debug("Setup task exists already for this Node") return None task = asyncio.create_task(self._setup_node(node_id)) + task.add_done_callback(lambda _: self._setup_node_tasks.pop(node_id, None)) self._setup_node_tasks[node_id] = task return task