Reduce API startup storage prewarm
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-16 19:21:27 +03:00
parent d738f3fc39
commit c27998693e
2 changed files with 7 additions and 4 deletions
@@ -105,8 +105,11 @@ class FileStorage:
directory = self._collection_dir(collection)
if not directory.exists():
return []
if limit is not None and limit <= 0:
return []
documents: list[dict[str, Any]] = []
for path in sorted(directory.glob("*.json")):
paths = directory.glob("*.json") if limit is not None else sorted(directory.glob("*.json"))
for path in paths:
try:
documents.append(orjson.loads(path.read_bytes()))
except (FileNotFoundError, orjson.JSONDecodeError):