Update Config.Load function to override default values if not set or wrong
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
d14cd161da
commit
4dfec86279
@ -71,6 +71,15 @@ func (c *Config) Load(filename string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// override values if not set or wrong
|
||||||
|
if c.HttpTimeOut <= 0 {
|
||||||
|
c.HttpTimeOut = 10
|
||||||
|
c.Save(filename)
|
||||||
|
}
|
||||||
|
if c.HttpLongPoll <= 1 {
|
||||||
|
c.HttpLongPoll = 300
|
||||||
|
c.Save(filename)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user