Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
istae committed Jan 23, 2024
1 parent be73f23 commit be41e7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pkg/storer/reserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storer/storer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down

0 comments on commit be41e7c

Please sign in to comment.