From 053690d88567d46252642589e77d759c499450da Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 13 May 2015 16:51:06 +0200 Subject: [PATCH] Don't attempt reschedule with zero interval Can happen on manual rescans of folders with zero interval. --- internal/model/rofolder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/model/rofolder.go b/internal/model/rofolder.go index b74acbf5d..74a9cce1f 100644 --- a/internal/model/rofolder.go +++ b/internal/model/rofolder.go @@ -51,6 +51,9 @@ func (s *roFolder) Serve() { }() reschedule := func() { + if s.intv == 0 { + return + } // Sleep a random time between 3/4 and 5/4 of the configured interval. sleepNanos := (s.intv.Nanoseconds()*3 + rand.Int63n(2*s.intv.Nanoseconds())) / 4 s.timer.Reset(time.Duration(sleepNanos) * time.Nanosecond)