[#339] pool/tree: Fix linter issues
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
parent
f78fb6dcb0
commit
c5991fc66d
3 changed files with 3 additions and 4 deletions
|
@ -23,7 +23,7 @@ type (
|
|||
|
||||
var ErrCBClosed = errors.New("circuit breaker is closed")
|
||||
|
||||
func NewCircuitBreaker(breakDuration time.Duration, threshold int) *circuitBreaker {
|
||||
func newCircuitBreaker(breakDuration time.Duration, threshold int) *circuitBreaker {
|
||||
return &circuitBreaker{
|
||||
breakDuration: breakDuration,
|
||||
threshold: threshold,
|
||||
|
|
|
@ -12,7 +12,7 @@ func TestCircuitBreaker(t *testing.T) {
|
|||
remoteErr := errors.New("service is being synchronized")
|
||||
breakDuration := 1 * time.Second
|
||||
threshold := 10
|
||||
cb := NewCircuitBreaker(breakDuration, threshold)
|
||||
cb := newCircuitBreaker(breakDuration, threshold)
|
||||
|
||||
// Hit threshold
|
||||
for i := 0; i < threshold; i++ {
|
||||
|
|
|
@ -254,7 +254,7 @@ func NewPool(options InitParameters) (*Pool, error) {
|
|||
methods: methods,
|
||||
netMapInfoSource: options.netMapInfoSource,
|
||||
clientMap: make(map[uint64]client),
|
||||
cb: NewCircuitBreaker(
|
||||
cb: newCircuitBreaker(
|
||||
options.circuitBreakerDuration,
|
||||
options.circuitBreakerThreshold,
|
||||
),
|
||||
|
@ -802,7 +802,6 @@ func fillDefaultInitParams(params *InitParameters) {
|
|||
|
||||
if params.circuitBreakerDuration <= 0 {
|
||||
params.circuitBreakerDuration = defaultCircuitBreakerDuration
|
||||
|
||||
}
|
||||
|
||||
if params.circuitBreakerThreshold <= 0 {
|
||||
|
|
Loading…
Add table
Reference in a new issue