mirror of
https://github.com/YunoHost/yunodevtools.git
synced 2024-09-03 20:16:19 +02:00
fix(clone_packages): handling the pagination to get the repo list
This commit is contained in:
parent
d8c6d6f5ce
commit
9e54b8ee32
1 changed files with 14 additions and 6 deletions
|
@ -31,14 +31,22 @@ def generate_mirror_list():
|
|||
|
||||
existing_clones = []
|
||||
|
||||
page = 1
|
||||
while True:
|
||||
data = requests.get(
|
||||
"https://git.yunohost.org/api/v1/repos/search?topic=false&includeDesc=false&priority_owner_id=17&mode=mirror",
|
||||
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"]
|
||||
|
||||
# once the data list is empty the whole available pages are consumed
|
||||
if not data:
|
||||
break
|
||||
|
||||
for repo in data:
|
||||
existing_clones.append(repo["name"])
|
||||
|
||||
page += 1
|
||||
|
||||
return existing_clones
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue