lib/model: Deduplicate folder loops
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4352 LGTM: AudriusButkevicius, calmh
This commit is contained in:
@@ -41,24 +41,7 @@ func (f *sendOnlyFolder) Serve() {
|
||||
|
||||
case <-f.scan.timer.C:
|
||||
l.Debugln(f, "Scanning subdirectories")
|
||||
err := f.scanSubdirs(nil)
|
||||
|
||||
select {
|
||||
case <-f.initialScanFinished:
|
||||
default:
|
||||
status := "Completed"
|
||||
if err != nil {
|
||||
status = "Failed"
|
||||
}
|
||||
l.Infoln(status, "initial scan (ro) of", f.Description())
|
||||
close(f.initialScanFinished)
|
||||
}
|
||||
|
||||
if f.scan.HasNoInterval() {
|
||||
continue
|
||||
}
|
||||
|
||||
f.scan.Reschedule()
|
||||
f.scanTimerFired()
|
||||
|
||||
case req := <-f.scan.now:
|
||||
req.err <- f.scanSubdirs(req.subdirs)
|
||||
|
||||
Reference in New Issue
Block a user