refactor(scanner): make the watcher a little easier to reason about (#394)

* add a test for symlinks escaping defined music paths

* refactor(scanner): make the watcher a little easier to reason about
This commit is contained in:
Senan Kelly
2023-10-24 23:57:42 +01:00
committed by GitHub
parent cae37255d6
commit c947404923
3 changed files with 76 additions and 72 deletions

View File

@@ -300,12 +300,13 @@ func main() {
defer logJob("scan watcher")()
done := make(chan struct{})
errgrp.Go(func() error {
<-ctx.Done()
scannr.CancelWatch()
done <- struct{}{}
return nil
})
return scannr.ExecuteWatch()
return scannr.ExecuteWatch(done)
})
errgrp.Go(func() error {