diff --git a/swh/storage/in_memory.py b/swh/storage/in_memory.py --- a/swh/storage/in_memory.py +++ b/swh/storage/in_memory.py @@ -201,7 +201,11 @@ yield None continue - yield {'sha1': obj_id, 'data': data} + if(end!=-1): + yield {'sha1': obj_id, 'data': data[start:end]} + else: + yield {'sha1': obj_id, 'data': data} + def content_get_range(self, start, end, limit=1000, db=None, cur=None): """Retrieve contents within range [start, end] bound by limit. diff --git a/swh/storage/storage.py b/swh/storage/storage.py --- a/swh/storage/storage.py +++ b/swh/storage/storage.py @@ -369,7 +369,10 @@ yield None continue - yield {'sha1': obj_id, 'data': data} + if(end!=-1): + yield {'sha1': obj_id, 'data': data[start:end]} + else: + yield {'sha1': obj_id, 'data': data} @db_transaction() def content_get_range(self, start, end, limit=1000, db=None, cur=None):