storage/config: fix example config, add warning for missing shardCount

This commit is contained in:
Leo Balduf
2017-05-12 13:16:39 +02:00
parent a4aeba7ecc
commit 71eb9fb767
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -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 {