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
This commit is contained in:
Antoine R. Dumont (@ardumont) 2022-10-04 10:57:32 +02:00
parent 94b6dbea0a
commit 1b4fe51f62
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8

View file

@ -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"]]