Page MenuHomeSoftware Heritage

D8605.id31084.diff
No OneTemporary

D8605.id31084.diff

diff --git a/swh/lister/nixguix/lister.py b/swh/lister/nixguix/lister.py
--- a/swh/lister/nixguix/lister.py
+++ b/swh/lister/nixguix/lister.py
@@ -28,6 +28,7 @@
from swh.core.github.utils import GitHubSession
from swh.core.tarball import MIMETYPE_TO_ARCHIVE_FORMAT
+from swh.core.utils import grouper
from swh.lister import TARBALL_EXTENSIONS
from swh.lister.pattern import CredentialsType, StatelessLister
from swh.scheduler.model import ListedOrigin
@@ -367,4 +368,7 @@
"""Given an artifact tuple (type, artifact), yield a ListedOrigin."""
artifact_type, artifact = artifact_tuple
mapping_type_fn = getattr(self, f"{artifact_type.value}_to_listed_origin")
- yield from mapping_type_fn(artifact)
+
+ # randomize a bit origins to not hit one server at the same time
+ for batch_origins in grouper(mapping_type_fn(artifact), n=5000):
+ yield from batch_origins

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 30, 9:43 AM (19 h, 11 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219559

Event Timeline