Skip to content

Commit 14ed130

Browse files
authored
fix: mark client retry backoff function as static (#429)
Ensure the function does not receive 2 arguments (self, retries)
1 parent d2540d4 commit 14ed130

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

hcloud/_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ class Client:
8383
_version = __version__
8484
__user_agent_prefix = "hcloud-python"
8585

86-
_retry_interval = exponential_backoff_function(
87-
base=1.0, multiplier=2, cap=60.0, jitter=True
86+
_retry_interval = staticmethod(
87+
exponential_backoff_function(base=1.0, multiplier=2, cap=60.0, jitter=True)
8888
)
8989
_retry_max_retries = 5
9090

@@ -291,7 +291,6 @@ def request( # type: ignore[no-untyped-def]
291291
error["code"] == "rate_limit_exceeded"
292292
and retries < self._retry_max_retries
293293
):
294-
# pylint: disable=too-many-function-args
295294
time.sleep(self._retry_interval(retries))
296295
retries += 1
297296
continue

0 commit comments

Comments
 (0)