forked from TrueCloudLab/frostfs-node
WIP: Morph: Add unit tests #2
1 changed files with 6 additions and 6 deletions
|
@ -76,7 +76,7 @@ type gc struct {
|
|||
|
||||
workerPool util.WorkerPool
|
||||
|
||||
remover func()
|
||||
remover func(context.Context)
|
||||
|
||||
eventChan chan Event
|
||||
mEventHandler map[eventType]*eventHandlers
|
||||
|
@ -115,7 +115,7 @@ func (gc *gc) init(ctx context.Context) {
|
|||
}
|
||||
|
||||
gc.wg.Add(2)
|
||||
go gc.tickRemover()
|
||||
go gc.tickRemover(ctx)
|
||||
go gc.listenEvents(ctx)
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ func (gc *gc) listenEvents(ctx context.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
func (gc *gc) tickRemover() {
|
||||
func (gc *gc) tickRemover(ctx context.Context) {
|
||||
defer gc.wg.Done()
|
||||
|
||||
timer := time.NewTimer(gc.removerInterval)
|
||||
|
@ -178,7 +178,7 @@ func (gc *gc) tickRemover() {
|
|||
gc.log.Debug(logs.ShardGCIsStopped)
|
||||
return
|
||||
case <-timer.C:
|
||||
gc.remover()
|
||||
gc.remover(ctx)
|
||||
timer.Reset(gc.removerInterval)
|
||||
}
|
||||
}
|
||||
|
@ -196,8 +196,8 @@ func (gc *gc) stop() {
|
|||
// iterates over metabase and deletes objects
|
||||
// with GC-marked graves.
|
||||
// Does nothing if shard is in "read-only" mode.
|
||||
func (s *Shard) removeGarbage() {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
func (s *Shard) removeGarbage(pctx context.Context) {
|
||||
ctx, cancel := context.WithCancel(pctx)
|
||||
defer cancel()
|
||||
|
||||
s.gcCancel.Store(cancel)
|
||||
|
|
Loading…
Reference in a new issue