lib/model, lib/config: Refactor folder health/error handling (fixes #4445, fixes #4451)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4455
LGTM: AudriusButkevicius, calmh
This commit is contained in:
Simon Frei
2017-10-24 07:58:55 +00:00
committed by Jakob Borg
parent a9c221189b
commit dc42db444b
9 changed files with 207 additions and 218 deletions

View File

@@ -2028,7 +2028,7 @@ func TestScanNoDatabaseWrite(t *testing.T) {
}
func TestIssue2782(t *testing.T) {
// CheckFolderHealth should accept a symlinked folder, when using tilde-expanded path.
// CheckHealth should accept a symlinked folder, when using tilde-expanded path.
if runtime.GOOS == "windows" {
t.Skip("not reliable on Windows")
@@ -2070,7 +2070,10 @@ func TestIssue2782(t *testing.T) {
t.Error("scan error:", err)
}
if err := m.CheckFolderHealth("default"); err != nil {
m.fmut.Lock()
runner, _ := m.folderRunners["default"]
m.fmut.Unlock()
if err := runner.CheckHealth(); err != nil {
t.Error("health check error:", err)
}
}