forked from TrueCloudLab/frostfs-node
[#956] node: Remove pool sizes from config struct
They are available through the pool methods and unused outside of the function that sets them. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
edbe06e07e
commit
426cf58b98
1 changed files with 8 additions and 14 deletions
|
@ -632,14 +632,8 @@ type cfgAccessPolicyEngine struct {
|
||||||
type cfgObjectRoutines struct {
|
type cfgObjectRoutines struct {
|
||||||
putRemote *ants.Pool
|
putRemote *ants.Pool
|
||||||
|
|
||||||
putRemoteCapacity int
|
|
||||||
|
|
||||||
putLocal *ants.Pool
|
putLocal *ants.Pool
|
||||||
|
|
||||||
putLocalCapacity int
|
|
||||||
|
|
||||||
replicatorPoolSize int
|
|
||||||
|
|
||||||
replication *ants.Pool
|
replication *ants.Pool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1094,20 +1088,20 @@ func initObjectPool(cfg *config.Config) (pool cfgObjectRoutines) {
|
||||||
|
|
||||||
optNonBlocking := ants.WithNonblocking(true)
|
optNonBlocking := ants.WithNonblocking(true)
|
||||||
|
|
||||||
pool.putRemoteCapacity = objectconfig.Put(cfg).PoolSizeRemote()
|
putRemoteCapacity := objectconfig.Put(cfg).PoolSizeRemote()
|
||||||
pool.putRemote, err = ants.NewPool(pool.putRemoteCapacity, optNonBlocking)
|
pool.putRemote, err = ants.NewPool(putRemoteCapacity, optNonBlocking)
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
|
|
||||||
pool.putLocalCapacity = objectconfig.Put(cfg).PoolSizeLocal()
|
putLocalCapacity := objectconfig.Put(cfg).PoolSizeLocal()
|
||||||
pool.putLocal, err = ants.NewPool(pool.putLocalCapacity, optNonBlocking)
|
pool.putLocal, err = ants.NewPool(putLocalCapacity, optNonBlocking)
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
|
|
||||||
pool.replicatorPoolSize = replicatorconfig.PoolSize(cfg)
|
replicatorPoolSize := replicatorconfig.PoolSize(cfg)
|
||||||
if pool.replicatorPoolSize <= 0 {
|
if replicatorPoolSize <= 0 {
|
||||||
pool.replicatorPoolSize = pool.putRemoteCapacity
|
replicatorPoolSize = putRemoteCapacity
|
||||||
}
|
}
|
||||||
|
|
||||||
pool.replication, err = ants.NewPool(pool.replicatorPoolSize)
|
pool.replication, err = ants.NewPool(replicatorPoolSize)
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
|
|
||||||
return pool
|
return pool
|
||||||
|
|
Loading…
Reference in a new issue