lib/model: Fix a few more problematic locks (ref #5929) (#5944)

This commit is contained in:
Simon Frei
2019-08-13 09:04:43 +02:00
committed by Jakob Borg
parent 86e35f1879
commit 6fa02d5081
2 changed files with 27 additions and 17 deletions

View File

@@ -685,10 +685,11 @@ func (f *folder) setWatchError(err error) {
// scanOnWatchErr schedules a full scan immediately if an error occurred while watching.
func (f *folder) scanOnWatchErr() {
f.watchMut.Lock()
if f.watchErr != nil {
err := f.watchErr
f.watchMut.Unlock()
if err != nil {
f.Delay(0)
}
f.watchMut.Unlock()
}
func (f *folder) setError(err error) {