lib/model, lib/scanner: Prevent races aborting scans (fixes #6994) (#6997)

This commit is contained in:
Simon Frei
2020-09-25 11:27:44 +02:00
committed by GitHub
parent c390565eef
commit 8452fd2ab4
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -136,6 +136,10 @@ func (ph *parallelHasher) hashFiles(ctx context.Context) {
func (ph *parallelHasher) closeWhenDone() {
ph.wg.Wait()
// In case the hasher aborted on context, wait for filesystem
// walking/progress routine to finish.
for range ph.inbox {
}
if ph.done != nil {
close(ph.done)
}