From 1b4fe51f62c706a9ef77b8eea74e111bb8be3542 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" Date: Tue, 4 Oct 2022 10:57:32 +0200 Subject: [PATCH] nixguix: Randomize order of listed origins The end goal is to ingest sparsely the origins, that would avoid hitting the various servers around the same time for colocated origins in the upstream manifest (especially file or tarball). Related to T3781 --- swh/lister/nixguix/lister.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swh/lister/nixguix/lister.py b/swh/lister/nixguix/lister.py index 6873977..ff08e1f 100644 --- a/swh/lister/nixguix/lister.py +++ b/swh/lister/nixguix/lister.py @@ -264,7 +264,10 @@ class NixGuixLister(StatelessLister[PageResult]): # grep '"type"' nixpkgs-sources-unstable.json | sort | uniq # "type": "url", - for artifact in raw_data["sources"]: + sources = raw_data["sources"] + random.shuffle(sources) + + for artifact in sources: artifact_type = artifact["type"] if artifact_type in VCS_SUPPORTED: plain_url = artifact[VCS_KEYS_MAPPING[artifact_type]["url"]]