Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit887852d

Browse files
Liora Milbaumnejch
Liora Milbaum
authored andcommitted
refactor: Moving RETRYABLE_TRANSIENT_ERROR_CODES to const
1 parent985b971 commit887852d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

‎gitlab/client.py

Lines 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
returnresult
782781

783782
if (429==result.status_codeandobey_rate_limit)or (
784-
result.status_codeinRETRYABLE_TRANSIENT_ERROR_CODES
783+
result.status_codeingitlab.const.RETRYABLE_TRANSIENT_ERROR_CODES
785784
andretry_transient_errors
786785
):
787786
# Response headers documentation:

‎gitlab/const.py

Lines 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",

‎tests/unit/test_gitlab_http_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
importresponses
77

88
fromgitlabimportGitlabHttpError,GitlabList,GitlabParsingError,RedirectError
9-
fromgitlab.clientimportRETRYABLE_TRANSIENT_ERROR_CODES
9+
fromgitlab.constimportRETRYABLE_TRANSIENT_ERROR_CODES
1010
fromtests.unitimporthelpers
1111

1212

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp