Reschedule the next scan interval (fixes #1591)

This commit is contained in:
Lode Hoste
2015-05-01 14:30:17 +02:00
parent 33048f88b8
commit fe34b08ece
7 changed files with 178 additions and 19 deletions

View File

@@ -49,6 +49,7 @@ type service interface {
Stop()
Jobs() ([]string, []string) // In progress, Queued
BringToFront(string)
DelayScan(d time.Duration)
setState(state folderState)
setError(err error)
@@ -1322,6 +1323,16 @@ nextSub:
return nil
}
func (m *Model) DelayScan(folder string, next time.Duration) {
m.fmut.Lock()
runner, ok := m.folderRunners[folder]
m.fmut.Unlock()
if !ok {
return
}
runner.DelayScan(next)
}
// numHashers returns the number of hasher routines to use for a given folder,
// taking into account configuration and available CPU cores.
func (m *Model) numHashers(folder string) int {