Sanity check the watch interval
This commit is contained in:
parent
3e6cf49394
commit
90f8c3588b
@ -149,6 +149,10 @@ func (c *ConfigService) Save() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Config.WatchInterval < 1 {
|
||||||
|
return fmt.Errorf("watch interval should be greater than 0 - '%d' invalid", c.Config.WatchInterval)
|
||||||
|
}
|
||||||
|
|
||||||
jsonString, _ := json.Marshal(c.Config)
|
jsonString, _ := json.Marshal(c.Config)
|
||||||
err := ioutil.WriteFile(c.ConfigFilename, jsonString, os.ModePerm)
|
err := ioutil.WriteFile(c.ConfigFilename, jsonString, os.ModePerm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user