chore: updates files

This commit is contained in:
jo 2024-07-31 09:05:33 +02:00 committed by renovate[bot]
parent 4878555361
commit 563e2bdd67
3 changed files with 12 additions and 9 deletions

View file

@ -86,8 +86,8 @@ class Client:
_version = __version__
__user_agent_prefix = "hcloud-python"
_retry_interval = exponential_backoff_function(
base=1.0, multiplier=2, cap=60.0, jitter=True
_retry_interval = staticmethod(
exponential_backoff_function(base=1.0, multiplier=2, cap=60.0, jitter=True)
)
_retry_max_retries = 5
@ -294,7 +294,6 @@ class Client:
error["code"] == "rate_limit_exceeded"
and retries < self._retry_max_retries
):
# pylint: disable=too-many-function-args
time.sleep(self._retry_interval(retries))
retries += 1
continue

View file

@ -1,3 +1,3 @@
from __future__ import annotations
__version__ = "2.1.0" # x-release-please-version
__version__ = "2.1.1" # x-release-please-version

View file

@ -28,14 +28,18 @@ class BoundAction(BoundModelBase, Action):
max_retries = self._client._client._poll_max_retries
retries = 0
while self.status == Action.STATUS_RUNNING:
while True:
self.reload()
if self.status != Action.STATUS_RUNNING:
break
retries += 1
if retries < max_retries:
self.reload()
retries += 1
# pylint: disable=protected-access
time.sleep(self._client._client._poll_interval_func(retries))
else:
raise ActionTimeoutException(action=self)
continue
raise ActionTimeoutException(action=self)
if self.status == Action.STATUS_ERROR:
raise ActionFailedException(action=self)