From 693af8c22866136e5ed620da87dd532a566cd916 Mon Sep 17 00:00:00 2001 From: danaelhe <42972711+danaelhe@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:29:00 -0400 Subject: [PATCH] Add retries documentation (#200) * Add retries documentation * lint * lint * Update README.md Co-authored-by: Ben Tranter --------- Co-authored-by: Ben Tranter --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 08ca4fce..eddbf029 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,21 @@ else: paginated = False ``` +#### Retries and Backoff + +By default the client uses the same retry policy as the [Azure SDK for Python](https://learn.microsoft.com/en-us/python/api/azure-core/azure.core.pipeline.policies.retrypolicy?view=azure-python). +retry policy. If you'd like to modify any of these values, you can pass them as keywords to your client initialization: + +```python +client = Client(token=os.getenv("$DIGITALOCEAN_TOKEN"), retry_total=3) +``` + +or + +```python +client = Client(token=os.getenv("$DIGITALOCEAN_TOKEN"), retry_policy=MyRetryPolicy()) +``` + # **Contributing** >Visit our [Contribuing Guide](CONTRIBUTING.md) for more information on getting