forked from TrueCloudLab/frostfs-node
[#2159] node: Add tree replication timeout configuration
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
parent
edb1428248
commit
306609030a
10 changed files with 36 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue