Skip to content

Commit b5b90ff

Browse files
committed
fixup! feat(molnix): use generator with local cache
1 parent d6d83fd commit b5b90ff

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

api/molnix_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,19 @@ def __iter__(self):
3838
if self._cached:
3939
logger.warning(
4040
"_CachedPaginated[%s] re-iteration #%d from cache %s",
41-
self._label, self._iter_count, self._cache_path,
41+
self._label,
42+
self._iter_count,
43+
self._cache_path,
4244
)
4345
with open(self._cache_path) as f:
4446
for line in f:
4547
yield json.loads(line)
4648
return
4749
logger.warning(
4850
"_CachedPaginated[%s] first iteration #%d streaming from source -> %s",
49-
self._label, self._iter_count, self._cache_path,
51+
self._label,
52+
self._iter_count,
53+
self._cache_path,
5054
)
5155
with open(self._cache_path, "w") as f:
5256
for item in self._source_factory():

0 commit comments

Comments
 (0)