Enable flake8-return linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-raise-rse.
This commit is contained in:
@@ -32,10 +32,10 @@ def fetch_urls(urls: list[str], data: any = None, headers: dict[str, str] = None
|
||||
if next_max_retries == 0:
|
||||
logging.error(f"Got ChunkedEncodingError while fetching {urls} ({e}), giving up")
|
||||
raise e # So that the function does not get stuck in an infinite loop.
|
||||
else:
|
||||
# We could wait a bit before retrying, but it's not clear if it would help.
|
||||
logging.warning(f"Got ChunkedEncodingError while fetching {urls} ({e}), retrying (remaining retries = {next_max_retries}).")
|
||||
return fetch_urls(urls, data, headers, next_max_retries, backoff_factor, timeout)
|
||||
|
||||
# We could wait a bit before retrying, but it's not clear if it would help.
|
||||
logging.warning(f"Got ChunkedEncodingError while fetching {urls} ({e}), retrying (remaining retries = {next_max_retries}).")
|
||||
return fetch_urls(urls, data, headers, next_max_retries, backoff_factor, timeout)
|
||||
|
||||
|
||||
def fetch_url(url: str, data: any = None, headers: dict[str, str] = None,
|
||||
|
||||
Reference in New Issue
Block a user