Properly populate cache during SingleFileStorage._at_once

The call to `list` was never awaited and the stream never drained, so
the cache remained empty.
This commit is contained in:
Hugo Osvaldo Barrera 2023-03-10 12:27:48 +01:00
parent 85ae33955f
commit b1ef68089b

View file

@ -193,7 +193,8 @@ class SingleFileStorage(Storage):
@contextlib.asynccontextmanager
async def at_once(self):
self.list()
async for _ in self.list():
pass
self._at_once = True
try:
yield self