diff --git a/swh/objstorage/api/client.py b/swh/objstorage/api/client.py --- a/swh/objstorage/api/client.py +++ b/swh/objstorage/api/client.py @@ -8,6 +8,8 @@ from swh.objstorage.exc import Error, ObjNotFoundError, ObjStorageAPIError from swh.objstorage.objstorage import DEFAULT_CHUNK_SIZE, DEFAULT_LIMIT +SHA1_SIZE = 20 + class RemoteObjStorage: """Proxy to a remote object storage. @@ -80,10 +82,12 @@ ) def __iter__(self): - yield from self._proxy.get_stream("content") + yield from self.list_content() def list_content(self, last_obj_id=None, limit=DEFAULT_LIMIT): params = {"limit": limit} if last_obj_id: params["last_obj_id"] = hashutil.hash_to_hex(last_obj_id) - yield from self._proxy.get_stream("content", params=params) + yield from self._proxy.get_stream( + "content", chunk_size=SHA1_SIZE, params=params + )