Skip to content

Commit 07c2b89

Browse files
zhyuJakob3xD
andcommitted
Update guides/retry_backoff.md
Co-authored-by: Jakob <[email protected]> Signed-off-by: Yu Zhang <[email protected]>
1 parent 2336e8e commit 07c2b89

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

guides/retry_backoff.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@ func main() {
2727

2828
func example() error {
2929
client, err := opensearchapi.NewClient(opensearchapi.Config{
30-
// Retry on 429 TooManyRequests statuses as well (502, 503, 504 are default values)
31-
//
32-
RetryOnStatus: []int{502, 503, 504, 429},
30+
// Retry on 429 TooManyRequests statuses as well (502, 503, 504 are default values)
31+
RetryOnStatus: []int{502, 503, 504, 429},
3332

34-
// A simple incremental backoff function
35-
//
36-
RetryBackoff: func(i int) time.Duration { return time.Duration(i) * 100 * time.Millisecond },
33+
// A simple incremental backoff function
34+
RetryBackoff: func(i int) time.Duration { return time.Duration(i) * 100 * time.Millisecond },
3735

38-
// Retry up to 5 attempts (1 initial + 4 retries)
39-
//
40-
MaxRetries: 4,
36+
// Retry up to 5 attempts (1 initial + 4 retries)
37+
MaxRetries: 4,
4138
})
4239
if err != nil {
4340
return err

0 commit comments

Comments
 (0)