comms: tolerate MAS login rate limits
This commit is contained in:
parent
976b5994dd
commit
88a4e93194
@ -235,8 +235,11 @@ spec:
|
||||
},
|
||||
timeout=30,
|
||||
)
|
||||
if r.status_code == 429:
|
||||
return False
|
||||
if r.status_code != 200:
|
||||
raise RuntimeError(f"login failed for {username}: {r.status_code} {r.text}")
|
||||
return True
|
||||
|
||||
wait_for_service(MAS_ADMIN_API_BASE)
|
||||
token = admin_token()
|
||||
@ -245,10 +248,10 @@ spec:
|
||||
bot_quick_pass = os.environ.get("BOT_PASS_QUICK", "")
|
||||
bot_smart_pass = os.environ.get("BOT_PASS_SMART", "")
|
||||
|
||||
ensure_user(token, os.environ["SEEDER_USER"], os.environ["SEEDER_PASS"])
|
||||
ensure_user(token, os.environ["BOT_USER"], os.environ["BOT_PASS"])
|
||||
if bot_quick and bot_quick_pass:
|
||||
ensure_user(token, os.environ["SEEDER_USER"], os.environ["SEEDER_PASS"])
|
||||
ensure_user(token, os.environ["BOT_USER"], os.environ["BOT_PASS"])
|
||||
if bot_quick and bot_quick_pass:
|
||||
ensure_user(token, bot_quick, bot_quick_pass)
|
||||
if bot_smart and bot_smart_pass:
|
||||
if bot_smart and bot_smart_pass:
|
||||
ensure_user(token, bot_smart, bot_smart_pass)
|
||||
PY
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user