Worker: use defaults for partial configuration
Instead of having a full "defaults OR the loaded config" (where a partial config file would thus have the nil value for missing properties) the missing properties now retain their default value.
This commit is contained in:
parent
0f2477370f
commit
bff5e30421
@ -67,16 +67,15 @@ func (fcw *FileConfigWrangler) WorkerConfig() (WorkerConfig, error) {
|
||||
return *fcw.wc, nil
|
||||
}
|
||||
|
||||
wc := WorkerConfig{}
|
||||
wc := fcw.DefaultConfig()
|
||||
err := fcw.loadConfig(configFilename, &wc)
|
||||
|
||||
if err != nil {
|
||||
if !os.IsNotExist(err) {
|
||||
return WorkerConfig{}, err
|
||||
return wc, err
|
||||
}
|
||||
|
||||
// The config file not existing is fine; just use the defaults.
|
||||
wc = fcw.DefaultConfig()
|
||||
}
|
||||
|
||||
fcw.wc = &wc
|
||||
|
Loading…
x
Reference in New Issue
Block a user