Skip to content

Commit 101b2d1

Browse files
authored
feat: retry requests when the api returns a timeout error (#617)
This error code explicitly document that the request should be retried.
1 parent 72a76a0 commit 101b2d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hcloud/_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class Client:
129129
130130
- ``conflict``
131131
- ``rate_limit_exceeded``
132+
- ``timeout``
132133
133134
Changes to the retry policy might occur between releases, and will not be considered
134135
breaking changes.
@@ -419,6 +420,7 @@ def _retry_policy(self, exception: APIException) -> bool:
419420
return exception.code in (
420421
"rate_limit_exceeded",
421422
"conflict",
423+
"timeout",
422424
)
423425

424426
if isinstance(exception.code, int):

0 commit comments

Comments
 (0)