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

Commitba7692a

Browse files
authored
Merge pull request#1965 from python-gitlab/fix/redundant-args-api
fix: avoid passing redundant arguments to API
2 parents07a16af +3431887 commitba7692a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎gitlab/client.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class Gitlab:
6363
pagination: Can be set to 'keyset' to use keyset pagination
6464
order_by: Set order_by globally
6565
user_agent: A custom user agent to use for making HTTP requests.
66-
retry_transient_errors: Whether to retry after 500, 502, 503,or
67-
504 responses. Defaults to False.
66+
retry_transient_errors: Whether to retry after 500, 502, 503,504
67+
or 52x responses. Defaults to False.
6868
"""
6969

7070
def__init__(
@@ -624,6 +624,7 @@ def http_request(
624624
files:Optional[Dict[str,Any]]=None,
625625
timeout:Optional[float]=None,
626626
obey_rate_limit:bool=True,
627+
retry_transient_errors:Optional[bool]=None,
627628
max_retries:int=10,
628629
**kwargs:Any,
629630
)->requests.Response:
@@ -642,6 +643,8 @@ def http_request(
642643
timeout: The timeout, in seconds, for the request
643644
obey_rate_limit: Whether to obey 429 Too Many Request
644645
responses. Defaults to True.
646+
retry_transient_errors: Whether to retry after 500, 502, 503, 504
647+
or 52x responses. Defaults to False.
645648
max_retries: Max retries after 429 or transient errors,
646649
set to -1 to retry forever. Defaults to 10.
647650
**kwargs: Extra options to send to the server (e.g. sudo)
@@ -679,14 +682,13 @@ def http_request(
679682
# If timeout was passed into kwargs, allow it to override the default
680683
iftimeoutisNone:
681684
timeout=opts_timeout
685+
ifretry_transient_errorsisNone:
686+
retry_transient_errors=self.retry_transient_errors
682687

683688
# We need to deal with json vs. data when uploading files
684689
json,data,content_type=self._prepare_send_data(files,post_data,raw)
685690
opts["headers"]["Content-type"]=content_type
686691

687-
retry_transient_errors=kwargs.get(
688-
"retry_transient_errors",self.retry_transient_errors
689-
)
690692
cur_retries=0
691693
whileTrue:
692694
try:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp