github.com/ethersphere/bee/v2@v2.2.0/pkg/storer/export_test.go (about)

     1  // Copyright 2023 The Swarm Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package storer
     6  
     7  import (
     8  	"github.com/ethersphere/bee/v2/pkg/storer/internal/events"
     9  	"github.com/ethersphere/bee/v2/pkg/storer/internal/reserve"
    10  )
    11  
    12  func (db *DB) Reserve() *reserve.Reserve {
    13  	return db.reserve
    14  }
    15  
    16  func (db *DB) Events() *events.Subscriber {
    17  	return db.events
    18  }
    19  
    20  func ReplaceSharkyShardLimit(val int) {
    21  	sharkyNoOfShards = val
    22  }
    23  
    24  func (db *DB) WaitForBgCacheWorkers() (unblock func()) {
    25  	for i := 0; i < defaultBgCacheWorkers; i++ {
    26  		db.cacheLimiter.sem <- struct{}{}
    27  	}
    28  	return func() {
    29  		for i := 0; i < defaultBgCacheWorkers; i++ {
    30  			<-db.cacheLimiter.sem
    31  		}
    32  	}
    33  }
    34  
    35  func DefaultOptions() *Options {
    36  	return defaultOptions()
    37  }