Skip to content
Snippets Groups Projects
Verified Commit 88709f6e authored by Antoine Lambert's avatar Antoine Lambert
Browse files

loader: Use all content hashes to fetch content bytes

When calling the content_get_data method from the storage interface,
ensure to provide all content hashes as parameter to avoid an extra
request on the storage server to fetch missing hashes.
parent ac006d3c
No related branches found
No related tags found
1 merge request!197loader: Use all content hashes to fetch content bytes
Pipeline #13492 passed
......@@ -53,6 +53,7 @@ from swh.model.model import (
SnapshotTargetType,
)
from swh.model.swhids import ExtendedObjectType
from swh.objstorage.interface import objid_from_dict
from swh.storage.algos.directory import directory_get
from swh.storage.algos.snapshot import snapshot_get_latest
from swh.storage.interface import StorageInterface
......@@ -549,7 +550,7 @@ class GitLoader(BaseGitLoader):
if cnts and cnts[0] is not None:
cnt = cnts[0]
d = cnt.to_dict()
d["data"] = storage.content_get_data(cnt.sha1)
d["data"] = storage.content_get_data(objid_from_dict(d))
cnt = Content.from_dict(d)
cnt.check()
set_ext_ref(Blob.type_num, content_git_object(cnt), "content")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment