diff options
author | Micah Lee <micah@micahflee.com> | 2022-01-16 15:49:33 -0800 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2022-01-16 15:49:33 -0800 |
commit | 9e99ad8b8d6f0eb0a2162191ec31a68e7c3acee5 (patch) | |
tree | 5a5215260866bd07adc60ead1ae0d1b6cd93174b /docs/check-weblate.py | |
parent | 74711e7d7c7b825fc580c612530569195156794a (diff) | |
parent | b4e022149d677f9c2acd639e9dfa77bcc712b068 (diff) | |
download | onionshare-9e99ad8b8d6f0eb0a2162191ec31a68e7c3acee5.tar.gz onionshare-9e99ad8b8d6f0eb0a2162191ec31a68e7c3acee5.zip |
Merge branch 'develop' of github.com:onionshare/onionshare into ros-fixes
Diffstat (limited to 'docs/check-weblate.py')
-rwxr-xr-x | docs/check-weblate.py | 14 |
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("") |