Try to fix fetch_urls when ChunkedEncodingError occurs (#188)

This commit is contained in:
Marc Wrobel
2023-11-26 13:58:27 +01:00
parent ce8e53213e
commit 7b90c02f62

View File

@@ -67,7 +67,7 @@ def result_or_retry(future) -> Response:
# According to https://stackoverflow.com/a/44511691/374236, most servers transmit all data, but that's not
# what was observed.
print(f"Got ChunkedEncodingError while fetching {e.request.url}, retrying...")
return fetch_urls([e.request.url], e.request.body, e.request.headers)[0]
return fetch_urls([e.response.url], e.request.body, e.request.headers)[0]
def fetch_url(url, data=None, headers=None, max_retries=5, backoff_factor=0.5, timeout=30) -> str: