Configuration on cicuitbreakers and load balancers
This commit is contained in:
parent
4fb25ca358
commit
0bdd537fb4
9 changed files with 222 additions and 66 deletions
|
@ -13,8 +13,8 @@ type CircuitBreaker struct {
|
|||
circuitBreaker *cbreaker.CircuitBreaker
|
||||
}
|
||||
|
||||
func NewCircuitBreaker(next http.Handler, options ...cbreaker.CircuitBreakerOption) *CircuitBreaker {
|
||||
circuitBreaker, _ := cbreaker.New(next, "NetworkErrorRatio() > 0.5", options...)
|
||||
func NewCircuitBreaker(next http.Handler, expression string, options ...cbreaker.CircuitBreakerOption) *CircuitBreaker {
|
||||
circuitBreaker, _ := cbreaker.New(next, expression, options...)
|
||||
return &CircuitBreaker{circuitBreaker}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue