Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 887852d

Browse filesBrowse files
Liora Milbaumnejch
authored andcommitted
refactor: Moving RETRYABLE_TRANSIENT_ERROR_CODES to const
1 parent 985b971 commit 887852d
Copy full SHA for 887852d

File tree

Expand file treeCollapse file tree

3 files changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎gitlab/client.py‎

Copy file name to clipboardExpand all lines: gitlab/client.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"{source!r} to {target!r}"
2323
)
2424

25-
RETRYABLE_TRANSIENT_ERROR_CODES = [500, 502, 503, 504] + list(range(520, 531))
2625

2726
# https://docs.gitlab.com/ee/api/#offset-based-pagination
2827
_PAGINATION_URL = (
@@ -781,7 +780,7 @@ def http_request(
781780
return result
782781

783782
if (429 == result.status_code and obey_rate_limit) or (
784-
result.status_code in RETRYABLE_TRANSIENT_ERROR_CODES
783+
result.status_code in gitlab.const.RETRYABLE_TRANSIENT_ERROR_CODES
785784
and retry_transient_errors
786785
):
787786
# Response headers documentation:
Collapse file

‎gitlab/const.py‎

Copy file name to clipboardExpand all lines: gitlab/const.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ class SearchScope(GitlabEnum):
131131

132132
USER_AGENT: str = f"{__title__}/{__version__}"
133133

134+
RETRYABLE_TRANSIENT_ERROR_CODES = [500, 502, 503, 504] + list(range(520, 531))
135+
134136
__all__ = [
135137
"AccessLevel",
136138
"Visibility",
Collapse file

‎tests/unit/test_gitlab_http_methods.py‎

Copy file name to clipboardExpand all lines: tests/unit/test_gitlab_http_methods.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import responses
77

88
from gitlab import GitlabHttpError, GitlabList, GitlabParsingError, RedirectError
9-
from gitlab.client import RETRYABLE_TRANSIENT_ERROR_CODES
9+
from gitlab.const import RETRYABLE_TRANSIENT_ERROR_CODES
1010
from tests.unit import helpers
1111

1212

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.