lib/model, lib/weakhash: Abort pulling quicker on folder stop (ref #5028)

This commit is contained in:
Simon Frei
2018-07-04 09:07:33 +02:00
committed by Audrius Butkevicius
parent 5bb72dfe5d
commit 0f0290d574
6 changed files with 118 additions and 39 deletions

View File

@@ -206,8 +206,13 @@ func (f *folder) Scan(subdirs []string) error {
subdirs: subdirs,
err: make(chan error),
}
f.scanNow <- req
return <-req.err
select {
case f.scanNow <- req:
return <-req.err
case <-f.ctx.Done():
return f.ctx.Err()
}
}
func (f *folder) Reschedule() {