[#2159] node: Add tree replication timeout configuration

Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
Pavel Karpy 2022-12-14 19:28:44 +03:00 committed by Anton Nikiforov
parent edb1428248
commit 306609030a
10 changed files with 36 additions and 3 deletions

View file

@ -2,6 +2,7 @@ package tree
import (
"crypto/ecdsa"
"time"
"github.com/TrueCloudLab/frostfs-node/pkg/core/container"
"github.com/TrueCloudLab/frostfs-node/pkg/core/netmap"
@ -30,6 +31,7 @@ type cfg struct {
// replication-related parameters
replicatorChannelCapacity int
replicatorWorkerCount int
replicatorTimeout time.Duration
containerCacheSize int
}
@ -106,3 +108,11 @@ func WithContainerCacheSize(n int) Option {
}
}
}
func WithReplicationTimeout(t time.Duration) Option {
return func(c *cfg) {
if t > 0 {
c.replicatorTimeout = t
}
}
}