@@ -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
7070def __init__ (
@@ -624,6 +624,7 @@ def http_request(
624624files :Optional [Dict [str ,Any ]]= None ,
625625timeout :Optional [float ]= None ,
626626obey_rate_limit :bool = True ,
627+ retry_transient_errors :Optional [bool ]= None ,
627628max_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
680683if timeout is None :
681684timeout = opts_timeout
685+ if retry_transient_errors is None :
686+ retry_transient_errors = self .retry_transient_errors
682687
683688# We need to deal with json vs. data when uploading files
684689json ,data ,content_type = self ._prepare_send_data (files ,post_data ,raw )
685690opts ["headers" ]["Content-type" ]= content_type
686691
687- retry_transient_errors = kwargs .get (
688- "retry_transient_errors" ,self .retry_transient_errors
689- )
690692cur_retries = 0
691693while True :
692694try :