From ab65063d6d23b793aa161c640ed24774718caba1 Mon Sep 17 00:00:00 2001
From: Pavel Karpy
Date: Fri, 5 May 2023 18:40:57 +0300
Subject: [PATCH] [#314] wc: Simplify background workers naming
Also, drop not used arg.
Signed-off-by: Pavel Karpy
---
pkg/local_object_storage/writecache/flush.go | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/pkg/local_object_storage/writecache/flush.go b/pkg/local_object_storage/writecache/flush.go
index 0437367e7..e0bada7a5 100644
--- a/pkg/local_object_storage/writecache/flush.go
+++ b/pkg/local_object_storage/writecache/flush.go
@@ -32,11 +32,11 @@ const (
func (c *cache) runFlushLoop() {
for i := 0; i < c.workersCount; i++ {
c.wg.Add(1)
- go c.flushWorker(i)
+ go c.workerFlushSmall()
}
c.wg.Add(1)
- go c.flushBigObjects()
+ go c.workerFlushBig()
c.wg.Add(1)
go func() {
@@ -48,7 +48,7 @@ func (c *cache) runFlushLoop() {
for {
select {
case <-tt.C:
- c.flushDB()
+ c.flushSmallObjects()
tt.Reset(defaultFlushInterval)
case <-c.closeCh:
return
@@ -57,7 +57,7 @@ func (c *cache) runFlushLoop() {
}()
}
-func (c *cache) flushDB() {
+func (c *cache) flushSmallObjects() {
var lastKey []byte
var m []objectInfo
for {
@@ -140,7 +140,7 @@ func (c *cache) flushDB() {
}
}
-func (c *cache) flushBigObjects() {
+func (c *cache) workerFlushBig() {
defer c.wg.Done()
tick := time.NewTicker(defaultFlushInterval * 10)
@@ -222,8 +222,8 @@ func (c *cache) flushFSTree(ignoreErrors bool) error {
return err
}
-// flushWorker writes objects to the main storage.
-func (c *cache) flushWorker(_ int) {
+// workerFlushSmall writes small objects to the main storage.
+func (c *cache) workerFlushSmall() {
defer c.wg.Done()
var obj *object.Object