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,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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue