From 07c2b89793e4d85621760af9053c3cb0da356096 Mon Sep 17 00:00:00 2001 From: Yu Zhang Date: Thu, 9 May 2024 10:34:52 +0900 Subject: [PATCH] Update guides/retry_backoff.md Co-authored-by: Jakob Signed-off-by: Yu Zhang --- guides/retry_backoff.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/guides/retry_backoff.md b/guides/retry_backoff.md index 5c66e26c..aa11f566 100644 --- a/guides/retry_backoff.md +++ b/guides/retry_backoff.md @@ -27,17 +27,14 @@ func main() { func example() error { client, err := opensearchapi.NewClient(opensearchapi.Config{ - // Retry on 429 TooManyRequests statuses as well (502, 503, 504 are default values) - // - RetryOnStatus: []int{502, 503, 504, 429}, + // Retry on 429 TooManyRequests statuses as well (502, 503, 504 are default values) + RetryOnStatus: []int{502, 503, 504, 429}, - // A simple incremental backoff function - // - RetryBackoff: func(i int) time.Duration { return time.Duration(i) * 100 * time.Millisecond }, + // A simple incremental backoff function + RetryBackoff: func(i int) time.Duration { return time.Duration(i) * 100 * time.Millisecond }, - // Retry up to 5 attempts (1 initial + 4 retries) - // - MaxRetries: 4, + // Retry up to 5 attempts (1 initial + 4 retries) + MaxRetries: 4, }) if err != nil { return err