Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion augur/tasks/github/util/github_data_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@

if response.status_code == 410:
response_msg = response.json().get("message")
if response_msg is not None:

Check warning on line 140 in augur/tasks/github/util/github_data_access.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise) Raw Output: augur/tasks/github/util/github_data_access.py:140:16: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
raise ResourceGoneException(response_msg)
else:
raise ResourceGoneException()
Expand All @@ -164,13 +164,13 @@
except RetryError as e:
raise e.last_attempt.exception()

def _decide_retry_policy(exception: Exception) -> bool:

Check warning on line 167 in augur/tasks/github/util/github_data_access.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 E0213: Method '_decide_retry_policy' should have "self" as first argument (no-self-argument) Raw Output: augur/tasks/github/util/github_data_access.py:167:4: E0213: Method '_decide_retry_policy' should have "self" as first argument (no-self-argument)
"""Defines whether or not to retry a failed request based on the exception thrown

Returns:
bool: Boolean describing whether or not the request should be retried
"""
return not isinstance(num, (UrlNotFoundException, ResourceGoneException))
return not isinstance(exception, (UrlNotFoundException, ResourceGoneException))

@retry(stop=stop_after_attempt(10), wait=wait_fixed(5), retry=retry_if_exception(_decide_retry_policy))
def __make_request_with_retries(self, url, method="GET", timeout=100):
Expand Down
Loading