From 426cf58b986dbf6c11e370fbdd9ca2788d0832d8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 2 Feb 2024 20:17:04 +0300 Subject: [PATCH] [#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 --- cmd/frostfs-node/config.go | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/cmd/frostfs-node/config.go b/cmd/frostfs-node/config.go index 29582c78..e5881cc2 100644 --- a/cmd/frostfs-node/config.go +++ b/cmd/frostfs-node/config.go @@ -632,14 +632,8 @@ type cfgAccessPolicyEngine struct { type cfgObjectRoutines struct { putRemote *ants.Pool - putRemoteCapacity int - putLocal *ants.Pool - putLocalCapacity int - - replicatorPoolSize int - replication *ants.Pool } @@ -1094,20 +1088,20 @@ func initObjectPool(cfg *config.Config) (pool cfgObjectRoutines) { optNonBlocking := ants.WithNonblocking(true) - pool.putRemoteCapacity = objectconfig.Put(cfg).PoolSizeRemote() - pool.putRemote, err = ants.NewPool(pool.putRemoteCapacity, optNonBlocking) + putRemoteCapacity := objectconfig.Put(cfg).PoolSizeRemote() + pool.putRemote, err = ants.NewPool(putRemoteCapacity, optNonBlocking) fatalOnErr(err) - pool.putLocalCapacity = objectconfig.Put(cfg).PoolSizeLocal() - pool.putLocal, err = ants.NewPool(pool.putLocalCapacity, optNonBlocking) + putLocalCapacity := objectconfig.Put(cfg).PoolSizeLocal() + pool.putLocal, err = ants.NewPool(putLocalCapacity, optNonBlocking) fatalOnErr(err) - pool.replicatorPoolSize = replicatorconfig.PoolSize(cfg) - if pool.replicatorPoolSize <= 0 { - pool.replicatorPoolSize = pool.putRemoteCapacity + replicatorPoolSize := replicatorconfig.PoolSize(cfg) + if replicatorPoolSize <= 0 { + replicatorPoolSize = putRemoteCapacity } - pool.replication, err = ants.NewPool(pool.replicatorPoolSize) + pool.replication, err = ants.NewPool(replicatorPoolSize) fatalOnErr(err) return pool