File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,14 +189,14 @@ def request( # type: ignore[no-untyped-def]
189189 self ,
190190 method : str ,
191191 url : str ,
192- tries : int = 1 ,
192+ * ,
193+ _tries : int = 1 ,
193194 ** kwargs ,
194195 ) -> dict :
195196 """Perform a request to the Hetzner Cloud API, wrapper around requests.request
196197
197198 :param method: HTTP Method to perform the Request
198199 :param url: URL of the Endpoint
199- :param tries: Tries of the request (used internally, should not be set by the user)
200200 :param timeout: Requests timeout in seconds
201201 :return: Response
202202 """
@@ -220,10 +220,10 @@ def request( # type: ignore[no-untyped-def]
220220 if not response .ok :
221221 if content :
222222 assert isinstance (content , dict )
223- if content ["error" ]["code" ] == "rate_limit_exceeded" and tries < 5 :
224- time .sleep (tries * self ._retry_wait_time )
225- tries = tries + 1
226- return self .request (method , url , tries , ** kwargs )
223+ if content ["error" ]["code" ] == "rate_limit_exceeded" and _tries < 5 :
224+ time .sleep (_tries * self ._retry_wait_time )
225+ _tries = _tries + 1
226+ return self .request (method , url , _tries = _tries , ** kwargs )
227227
228228 self ._raise_exception_from_content (content )
229229 else :
You can’t perform that action at this time.
0 commit comments