[#339] pool/tree: Fix linter issues
All checks were successful
DCO / DCO (pull_request) Successful in 28s
Code generation / Generate proto (pull_request) Successful in 32s
Tests and linters / Tests (pull_request) Successful in 44s
Tests and linters / Lint (pull_request) Successful in 1m27s

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
Alexey Vanin 2025-03-04 12:20:24 +03:00
parent f78fb6dcb0
commit c5991fc66d
3 changed files with 3 additions and 4 deletions

View file

@ -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,

View file

@ -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++ {

View file

@ -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 {