From f769fc83fc4e501e18203d0229714021f2723e71 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sun, 16 Oct 2022 15:07:38 +0300 Subject: [PATCH] [#1869] shard: Embed `gcCfg` as raw struct Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/shard/control.go | 2 +- pkg/local_object_storage/shard/gc.go | 4 ++-- pkg/local_object_storage/shard/shard.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index c48275e09a..30b227b2ab 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -135,7 +135,7 @@ func (s *Shard) Init() error { s.updateObjectCounter() s.gc = &gc{ - gcCfg: s.gcCfg, + gcCfg: &s.gcCfg, remover: s.removeGarbage, stopChannel: make(chan struct{}), eventChan: make(chan Event), diff --git a/pkg/local_object_storage/shard/gc.go b/pkg/local_object_storage/shard/gc.go index 04f72a97e6..75db47cf44 100644 --- a/pkg/local_object_storage/shard/gc.go +++ b/pkg/local_object_storage/shard/gc.go @@ -82,8 +82,8 @@ type gcCfg struct { workerPoolInit func(int) util.WorkerPool } -func defaultGCCfg() *gcCfg { - return &gcCfg{ +func defaultGCCfg() gcCfg { + return gcCfg{ removerInterval: 10 * time.Second, log: &logger.Logger{Logger: zap.L()}, workerPoolInit: func(int) util.WorkerPool { diff --git a/pkg/local_object_storage/shard/shard.go b/pkg/local_object_storage/shard/shard.go index ad7852377d..d364160049 100644 --- a/pkg/local_object_storage/shard/shard.go +++ b/pkg/local_object_storage/shard/shard.go @@ -85,7 +85,7 @@ type cfg struct { log *logger.Logger - gcCfg *gcCfg + gcCfg gcCfg expiredTombstonesCallback ExpiredTombstonesCallback