Open petersilva opened 7 months ago
Have a look at 'e50e8e4b9a70f6a55de5e1898b10e9b6597f3afb' commit in the branch 'improve_airnow_poll'. I think the new HTTP(s) logic in there might be the solution.
You could change the 'max_retry' value. The retries are done via exponential backoff.
code snippet from @andreleblanc11
# Setup an HTTP session. Set it up where we can retry 3 times if ever it fails and have exponential backoff applied.
# Backoff_factor set to 1 so normal exponential backoff.
session = requests.Session()
retry = Retry(connect=3, backoff_factor=1)
adapter = HTTPAdapter(max_retries=retry)
session.mount('http://', adapter)
session.mount('https://', adapter)
resp = session.get(URL)
so... sr3 processes messages in batches, and amortizes connections over those batches. If one message transfer fails, it just tries the next one. For many cases (like 404) that's fine, maybe the next one does exist, but in the Too Many Requests case, it will never help, and likely hurt:
It would be good to put some smarts in the https downloader to back off for a bit when this error is received.