From: Bjørn Erik Pedersen Date: Sat, 13 Nov 2021 20:45:51 +0000 (+0100) Subject: commands: Make sure pollInterval is always set X-Git-Tag: v0.89.3~5 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fdad91fd9;p=brevno-suite%2Fhugo commands: Make sure pollInterval is always set Fixes #9165 --- diff --git a/commands/hugo.go b/commands/hugo.go index 6be3776bc..d442a62b5 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -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