Skip to content

Commit

Permalink
Change clear_local to be parallellized.
Browse files Browse the repository at this point in the history
  • Loading branch information
rohinb2 committed Apr 16, 2024
1 parent 706595e commit 8044b49
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions runhouse/servers/obj_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,9 +931,10 @@ async def aclear_for_env_servlet_name(env_servlet_name: str):

async def aclear_local(self):
if self.has_local_storage:
for k in list(self._kv_store.keys()):
# Pop handles removing from global obj store vs local one
await self.apop_local(k)
# Use asyncio gather to run all the deletes concurrently
await asyncio.gather(
*[self.apop_local(k) for k in list(self._kv_store.keys())]
)

async def aclear(self):
logger.warning("Clearing all keys from all envs in the object store!")
Expand Down

0 comments on commit 8044b49

Please sign in to comment.