File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -189,14 +189,14 @@ def request( # type: ignore[no-untyped-def]
189
189
self ,
190
190
method : str ,
191
191
url : str ,
192
- tries : int = 1 ,
192
+ * ,
193
+ _tries : int = 1 ,
193
194
** kwargs ,
194
195
) -> dict :
195
196
"""Perform a request to the Hetzner Cloud API, wrapper around requests.request
196
197
197
198
:param method: HTTP Method to perform the Request
198
199
:param url: URL of the Endpoint
199
- :param tries: Tries of the request (used internally, should not be set by the user)
200
200
:param timeout: Requests timeout in seconds
201
201
:return: Response
202
202
"""
@@ -220,10 +220,10 @@ def request( # type: ignore[no-untyped-def]
220
220
if not response .ok :
221
221
if content :
222
222
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 )
227
227
228
228
self ._raise_exception_from_content (content )
229
229
else :
You can’t perform that action at this time.
0 commit comments