Skip to content

Commit

Permalink
Cancel setup task on node removal
Browse files Browse the repository at this point in the history
  • Loading branch information
agners committed Sep 4, 2024
1 parent 66faa0b commit 69a20c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,9 @@ async def remove_node(self, node_id: int) -> None:

LOGGER.info("Removing Node ID %s.", node_id)

if task := self._setup_node_with_retry_tasks.pop(node_id, None):
task.cancel()

# shutdown any existing subscriptions
await self._chip_device_controller.shutdown_subscription(node_id)
self._polled_attributes.pop(node_id, None)
Expand Down

0 comments on commit 69a20c4

Please sign in to comment.