aboutsummaryrefslogtreecommitdiff
path: root/docs/check-weblate.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/check-weblate.py')
-rwxr-xr-xdocs/check-weblate.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/docs/check-weblate.py b/docs/check-weblate.py
index ee828f93..76cc6942 100755
--- a/docs/check-weblate.py
+++ b/docs/check-weblate.py
@@ -13,9 +13,13 @@ docs_translations = {}
async def api(path):
url = f"https://hosted.weblate.org{path}"
+ # Wait a bit before each API call, to avoid hammering the server and
+ # getting temporarily blocked
+ await asyncio.sleep(1)
+
async with httpx.AsyncClient() as client:
r = await client.get(
- url, headers={"Authorization": f"Token {api_token}"}, timeout=30.0
+ url, headers={"Authorization": f"Token {api_token}"}, timeout=60
)
if r.status_code == 200:
@@ -109,7 +113,8 @@ async def main():
languages[obj["code"]] = obj["language"]
# Get the app translations for each language
- await asyncio.gather(*[get_app_translation(lang_code) for lang_code in languages])
+ for lang_code in languages:
+ await get_app_translation(lang_code)
# Get the documentation translations for each component for each language
for component in [
@@ -123,11 +128,8 @@ async def main():
"doc-sphinx",
"doc-tor",
]:
- docs_futures = []
for lang_code in languages:
- docs_futures.append(get_docs_translation(component, lang_code))
-
- await asyncio.gather(*docs_futures)
+ await get_docs_translation(component, lang_code)
print("")