mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-01 22:38:59 -07:00
storage/config: fix example config, add warning for missing shardCount
This commit is contained in:
@@ -63,9 +63,12 @@ func (cfg Config) LogFields() log.Fields {
|
||||
|
||||
// New creates a new PeerStore backed by memory.
|
||||
func New(cfg Config) (storage.PeerStore, error) {
|
||||
shardCount := 1
|
||||
var shardCount int
|
||||
if cfg.ShardCount > 0 {
|
||||
shardCount = cfg.ShardCount
|
||||
} else {
|
||||
log.Warnln("storage: shardCount not configured, using 1 as default value.")
|
||||
shardCount = 1
|
||||
}
|
||||
|
||||
if cfg.GarbageCollectionInterval <= 0 {
|
||||
|
||||
Reference in New Issue
Block a user