Skip to content

Commit

Permalink
Cleaner reset
Browse files Browse the repository at this point in the history
  • Loading branch information
language-shprt committed Jan 10, 2025
1 parent 25eff6b commit 3b7b6dd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions asab/web/tenant/providers/zookeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ async def update(self):
external_tenants = await self.ZookeeperClient.get_children(self.ZKPath)

elif zk_node_exists is None:
self.Tenants = set() # Reset data from last iteration
self._set_ready(True) # Provider was checked (no data in ZK) => True
external_tenants = set() # To reset data from last iteration
L.debug("Found no tenants data: zk node doesn't exist", struct_data={"path": self.ZKPath})
return

except Exception as e:
self._set_ready(False) # Failed to check the provider
Expand All @@ -64,4 +62,4 @@ async def update(self):
self.App.PubSub.publish("Tenants.change!")

if not self._IsReady:
self._set_ready(True) # Provider was checked => True
self._set_ready(True) # Provider was checked (including no data in ZK) => True

0 comments on commit 3b7b6dd

Please sign in to comment.