Skip to content

Commit

Permalink
place logging within lock
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Jul 11, 2023
1 parent 359a10c commit 6c9d5bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,9 @@ async def _subscribe_node(self, node_id: int) -> None:
node_logger.debug("Unsubscribing from existing subscription.")
await self._call_sdk(prev_sub.Shutdown)

node_logger.debug("Setting up attributes and events subscription.")
self._attr_subscriptions[node_id] = attr_subscriptions
async with node_lock:
node_logger.debug("Setting up attributes and events subscription.")
sub: Attribute.SubscriptionTransaction = await self.chip_controller.Read(
nodeid=node_id,
# In order to prevent network congestion due to wildcard subscriptions on all nodes,
Expand Down Expand Up @@ -844,8 +844,8 @@ async def _resolve_node(self, node_id: int, retries: int = 3) -> None:
if self.chip_controller is None:
raise RuntimeError("Device Controller not initialized.")
try:
LOGGER.info("Attempting to resolve node %s...", node_id)
async with node_lock, self._resolve_lock:
LOGGER.info("Attempting to resolve node %s...", node_id)
await self._call_sdk(
self.chip_controller.ResolveNode,
nodeid=node_id,
Expand Down

0 comments on commit 6c9d5bc

Please sign in to comment.