| 340 | } |
| 341 | |
| 342 | func (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 | |
| 353 | func (f *folder) getHealthErrorAndLoadIgnores() error { |
| 354 | if err := f.getHealthErrorWithoutIgnores(); err != nil { |