Skip to content

Commit

Permalink
fix: registry loader time
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Oct 12, 2023
1 parent 1d89a65 commit 0d185f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yearn/v2/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ def __repr__(self) -> str:

@set_exc
async def watch_events(self) -> NoReturn:
start = await dank_w3.eth.block_number
start = time.time()
events = await self._events
def done_callback(task: asyncio.Task) -> None:
logger.info("loaded v2 registry in %.3fs", time.time() - start)
self._done.set()
done_task = asyncio.create_task(events._lock.wait_for(start))
done_task = asyncio.create_task(events._lock.wait_for(await dank_w3.eth.block_number))
done_task.add_done_callback(done_callback)
async for _ in events:
self._filter_vaults()
Expand Down

0 comments on commit 0d185f7

Please sign in to comment.