forked from TrueCloudLab/frostfs-node
[#1550] engine: Set default error threshold
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
a6d1eefeff
commit
dafc21b052
1 changed files with 7 additions and 1 deletions
|
@ -75,10 +75,14 @@ type cfg struct {
|
|||
shardPoolSize uint32
|
||||
}
|
||||
|
||||
const defaultErrorThreshold = 30
|
||||
|
||||
func defaultCfg() *cfg {
|
||||
return &cfg{
|
||||
log: zap.L(),
|
||||
|
||||
errorsThreshold: defaultErrorThreshold,
|
||||
|
||||
shardPoolSize: 20,
|
||||
}
|
||||
}
|
||||
|
@ -123,6 +127,8 @@ func WithShardPoolSize(sz uint32) Option {
|
|||
// shard is moved to read-only mode.
|
||||
func WithErrorThreshold(sz uint32) Option {
|
||||
return func(c *cfg) {
|
||||
c.errorsThreshold = sz
|
||||
if sz != 0 {
|
||||
c.errorsThreshold = sz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue