Add defaults
This commit is contained in:
@@ -163,6 +163,17 @@ func loadConfig(yamlFile string) Config {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to parse YAML: %v", err)
|
log.Fatalf("Failed to parse YAML: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set defaults for log entries
|
||||||
|
for i := range config.Logs {
|
||||||
|
if config.Logs[i].PoolSize == 0 {
|
||||||
|
config.Logs[i].PoolSize = 750
|
||||||
|
}
|
||||||
|
if config.Logs[i].Period == 0 {
|
||||||
|
config.Logs[i].Period = 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user