handle 429 returned by HIBP
This commit is contained in:
parent
38de6118ee
commit
ec763544f1
5
cron.py
5
cron.py
|
@ -801,6 +801,11 @@ async def _hibp_check(api_key, queue):
|
||||||
elif r.status_code == 404:
|
elif r.status_code == 404:
|
||||||
# No breaches found
|
# No breaches found
|
||||||
alias.hibp_breaches = []
|
alias.hibp_breaches = []
|
||||||
|
elif r.status_code == 429:
|
||||||
|
# rate limited
|
||||||
|
LOG.w("HIBP rate limited, check alias %s in the next run", alias)
|
||||||
|
await asyncio.sleep(1.6)
|
||||||
|
return
|
||||||
elif r.status_code > 500:
|
elif r.status_code > 500:
|
||||||
LOG.w("HIBP server 5** error %s", r.status_code)
|
LOG.w("HIBP server 5** error %s", r.status_code)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue