mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-18 19:15:19 +00:00
Don't attempt reschedule with zero interval
Can happen on manual rescans of folders with zero interval.
This commit is contained in:
parent
b9fc6397a3
commit
053690d885
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user