From 307bb944d5c141aa4c4a224dbc307a1eab2ce1c7 Mon Sep 17 00:00:00 2001
From: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date: Thu, 18 Apr 2024 17:15:00 +0200
Subject: [PATCH] indexer: use CompositeObjIds in objstorage.get_batch

---
 swh/indexer/indexer.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/swh/indexer/indexer.py b/swh/indexer/indexer.py
index 63de74a9..54121f80 100644
--- a/swh/indexer/indexer.py
+++ b/swh/indexer/indexer.py
@@ -22,6 +22,7 @@ from swh.model import hashutil
 from swh.model.model import Directory, Origin, Sha1Git
 from swh.objstorage.exc import ObjNotFoundError
 from swh.objstorage.factory import get_objstorage
+from swh.objstorage.interface import objid_from_dict
 from swh.storage import get_storage
 from swh.storage.interface import StorageInterface
 
@@ -302,8 +303,7 @@ class ContentIndexer(BaseIndexer[Sha1, bytes, TResult], Generic[TResult]):
         try:
             results = []
             contents = objects.get("content", [])
-            # FIXME: with swh.objstorage > v2.0: self.objstorage.get_batch(contents)
-            content_data = self.objstorage.get_batch(c["sha1"] for c in contents)
+            content_data = self.objstorage.get_batch(map(objid_from_dict, contents))
             for item, raw_content in zip(contents, content_data):
                 id_ = item["sha1"]
                 sentry_sdk.set_tag(
-- 
GitLab