From 22f0077262181d438905b3f0cf6ae9601dad9c58 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 18 Jun 2020 15:13:46 +0200 Subject: [PATCH] lib/model: Don't stay scanning forever on fail (#6761) --- lib/model/folder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/model/folder.go b/lib/model/folder.go index 57b154bb0..a78ac4b8f 100644 --- a/lib/model/folder.go +++ b/lib/model/folder.go @@ -361,6 +361,7 @@ func (f *folder) scanSubdirs(subDirs []string) error { }() f.setState(FolderScanWaiting) + defer f.setState(FolderIdle) if err := f.ioLimiter.takeWithContext(f.ctx, 1); err != nil { return err @@ -627,7 +628,6 @@ func (f *folder) scanSubdirs(subDirs []string) error { } f.ScanCompleted() - f.setState(FolderIdle) return nil }