fix(clone_packages): handling the pagination to get the repo list

This commit is contained in:
Laurent Peuch 2024-05-05 22:04:07 +02:00
parent d8c6d6f5ce
commit 9e54b8ee32

View file

@ -31,13 +31,21 @@ def generate_mirror_list():
existing_clones = [] existing_clones = []
data = requests.get( page = 1
"https://git.yunohost.org/api/v1/repos/search?topic=false&includeDesc=false&priority_owner_id=17&mode=mirror", while True:
timeout=60, data = requests.get(
).json()["data"] f"https://git.yunohost.org/api/v1/repos/search?topic=false&includeDesc=false&priority_owner_id=17&mode=mirror&page={page}&limit=100",
timeout=60,
).json()["data"]
for repo in data: # once the data list is empty the whole available pages are consumed
existing_clones.append(repo["name"]) if not data:
break
for repo in data:
existing_clones.append(repo["name"])
page += 1
return existing_clones return existing_clones