forked from TrueCloudLab/frostfs-node
[#642] writecache: Remove usage of close channel in badger
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
b0cf100427
commit
c0b86f2d93
3 changed files with 30 additions and 34 deletions
|
@ -1,12 +1,13 @@
|
|||
package writecachebadger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
)
|
||||
|
||||
func (c *cache) runGCLoop() {
|
||||
func (c *cache) runGCLoop(ctx context.Context) {
|
||||
c.wg.Add(1)
|
||||
|
||||
go func() {
|
||||
|
@ -17,7 +18,7 @@ func (c *cache) runGCLoop() {
|
|||
|
||||
for {
|
||||
select {
|
||||
case <-c.closeCh:
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-t.C:
|
||||
// This serves to synchronize the c.db field when changing mode as well.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue