From dafc21b05293b920c78f0d108c3e13e0c1e2c7ce Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 27 Jun 2022 09:52:48 +0300 Subject: [PATCH] [#1550] engine: Set default error threshold Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/engine/engine.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/local_object_storage/engine/engine.go b/pkg/local_object_storage/engine/engine.go index 19b877ce6..fec9e24d2 100644 --- a/pkg/local_object_storage/engine/engine.go +++ b/pkg/local_object_storage/engine/engine.go @@ -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 + } } }