From be41e7cb1a7c6c2bbae0e2d0d0b7b1effb372965 Mon Sep 17 00:00:00 2001 From: istae <14264581+istae@users.noreply.github.com> Date: Tue, 23 Jan 2024 18:26:35 +0300 Subject: [PATCH] fix: cleanup --- pkg/storer/reserve.go | 3 +-- pkg/storer/storer.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/storer/reserve.go b/pkg/storer/reserve.go index 6bd00644557..690736e7302 100644 --- a/pkg/storer/reserve.go +++ b/pkg/storer/reserve.go @@ -42,7 +42,6 @@ func threshold(capacity int) int { return capacity * 5 / 10 } func (db *DB) startReserveWorkers( ctx context.Context, - warmupDur, wakeUpDur time.Duration, radius func() (uint8, error), ) { ctx, cancel := context.WithCancel(ctx) @@ -57,7 +56,7 @@ func (db *DB) startReserveWorkers( go db.evictionWorker(ctx) select { - case <-time.After(warmupDur): + case <-time.After(db.opts.warmupDuration): case <-db.quit: return } diff --git a/pkg/storer/storer.go b/pkg/storer/storer.go index 35cab3f0e4f..9c710901410 100644 --- a/pkg/storer/storer.go +++ b/pkg/storer/storer.go @@ -618,7 +618,7 @@ func (db *DB) SetRetrievalService(r retrieval.Interface) { func (db *DB) StartReserveWorker(ctx context.Context, s Syncer, radius func() (uint8, error)) { db.setSyncerOnce.Do(func() { db.syncer = s - go db.startReserveWorkers(ctx, db.opts.warmupDuration, db.opts.wakeupDuration, radius) + go db.startReserveWorkers(ctx, radius) }) }