Skip to content

Commit

Permalink
Resolved github actions and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrahul committed Oct 15, 2023
1 parent 2f9f484 commit 37b35e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
File renamed without changes.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,25 @@ if err == retry.ErrDeadlineExceeded {
}

```
### Retry failed operations with a maximum 10 retries and with an Custom Backoff function.
```
### Retry failed operations with a deadline of 1 minute and with ExponentialBackoff. Every retry the delay will be twice compared to the previous delay. But the maximum delay will be 10 seconds.
```go
err := retry.Retry(func() bool {
err := doesHeavyLifting()
if err != nil {
return true // retry operation
}
return false // No need to retry
}, 1 * time.Minute(), retry.ExponentialBackoff(10))
if err == retry.ErrDeadlineExceeded {
fmt.Error("Retry deadline exceeded")
}
```
### Retry failed operations with a maximum 10 retries and with an Custom Backoff function. Delay will be 1.5 times compared to the previous delay.

```go
err := retry.Retry(func() bool {
Expand Down

0 comments on commit 37b35e3

Please sign in to comment.