MCPcopy
hub / github.com/syncthing/syncthing / Reschedule

Method Reschedule

lib/model/folder.go:342–351  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

340}
341
342func (f *folder) Reschedule() {
343 if f.scanInterval == 0 {
344 return
345 }
346 // Sleep a random time between 3/4 and 5/4 of the configured interval.
347 sleepNanos := (f.scanInterval.Nanoseconds()*3 + rand.Int63n(2*f.scanInterval.Nanoseconds())) / 4 //nolint:gosec
348 interval := time.Duration(sleepNanos) * time.Nanosecond
349 f.sl.Debug("Next rescan scheduled", slog.Duration("interval", interval))
350 f.scanTimer.Reset(interval)
351}
352
353func (f *folder) getHealthErrorAndLoadIgnores() error {
354 if err := f.getHealthErrorWithoutIgnores(); err != nil {

Callers 1

scanTimerFiredMethod · 0.95

Calls 1

ResetMethod · 0.65

Tested by

no test coverage detected