Skip to content

Commit

Permalink
rpcclient: fix returning nil err on retry
Browse files Browse the repository at this point in the history
  • Loading branch information
jazg committed Aug 22, 2019
1 parent 59a4d95 commit ca81ff8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rpcclient/rpcclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ func retry(ctx context.Context, delay time.Duration, fn func() error) error {
for {
select {
case <-ctx.Done():
return err
if err != nil {
return err
}
return ctx.Err()
case <-ticker.C:
err = fn()
if err == nil {
Expand Down

0 comments on commit ca81ff8

Please sign in to comment.