forked from TrueCloudLab/frostfs-sdk-go
[#358] pool: Make ErrPoolClientUnhealthy unexported
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
5f9d846fb4
commit
e35f0df1ca
1 changed files with 4 additions and 4 deletions
|
@ -95,8 +95,8 @@ type clientStatus interface {
|
||||||
methodsStatus() []statusSnapshot
|
methodsStatus() []statusSnapshot
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrPoolClientUnhealthy is an error to indicate that client in pool is unhealthy.
|
// errPoolClientUnhealthy is an error to indicate that client in pool is unhealthy.
|
||||||
var ErrPoolClientUnhealthy = errors.New("pool client unhealthy")
|
var errPoolClientUnhealthy = errors.New("pool client unhealthy")
|
||||||
|
|
||||||
// clientStatusMonitor count error rate and other statistics for connection.
|
// clientStatusMonitor count error rate and other statistics for connection.
|
||||||
type clientStatusMonitor struct {
|
type clientStatusMonitor struct {
|
||||||
|
@ -302,7 +302,7 @@ func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, change
|
||||||
var wasHealthy bool
|
var wasHealthy bool
|
||||||
if _, err := c.endpointInfo(ctx, prmEndpointInfo{}); err == nil {
|
if _, err := c.endpointInfo(ctx, prmEndpointInfo{}); err == nil {
|
||||||
return true, false
|
return true, false
|
||||||
} else if !errors.Is(err, ErrPoolClientUnhealthy) {
|
} else if !errors.Is(err, errPoolClientUnhealthy) {
|
||||||
wasHealthy = true
|
wasHealthy = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ func (c *clientWrapper) getClient() (*sdkClient.Client, error) {
|
||||||
if c.isHealthy() {
|
if c.isHealthy() {
|
||||||
return c.client, nil
|
return c.client, nil
|
||||||
}
|
}
|
||||||
return nil, ErrPoolClientUnhealthy
|
return nil, errPoolClientUnhealthy
|
||||||
}
|
}
|
||||||
|
|
||||||
// balanceGet invokes sdkClient.BalanceGet parse response status to error and return result as is.
|
// balanceGet invokes sdkClient.BalanceGet parse response status to error and return result as is.
|
||||||
|
|
Loading…
Reference in a new issue