commands: Make sure pollInterval is always set

Fixes #9165
This commit is contained in:
Bjørn Erik Pedersen 2021-11-13 21:45:51 +01:00
parent 5f3f60898c
commit fdad91fd96
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -845,6 +845,10 @@ func (c *commandeer) newWatcher(pollIntervalStr string, dirList ...string) (*wat
c.logger.Printf("Use watcher with poll interval %v", pollInterval)
}
if pollInterval == 0 {
pollInterval = 500 * time.Millisecond
}
watcher, err := watcher.New(500*time.Millisecond, pollInterval, poll)
if err != nil {
return nil, err