Skip to content

Commit

Permalink
optimize: add SetRetryIf
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jin-gou committed Oct 21, 2022
1 parent a8b4a97 commit 47bb526
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/app/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ func (c *Client) SetRetryIfFunc(retryIf client.RetryIfFunc) {
c.RetryIfFunc = retryIf
}

// Deprecated: use SetRetryIfFunc instead of SetRetryIf
func (c *Client) SetRetryIf(fn func(request *protocol.Request) bool) {
f := func(req *protocol.Request, resp *protocol.Response, err error) bool {
return fn(req)
}
c.SetRetryIfFunc(f)
}

// SetProxy is used to set client proxy.
//
// Don't SetProxy twice for a client.
Expand Down

0 comments on commit 47bb526

Please sign in to comment.