MCPcopy
hub / github.com/syncthing/syncthing / clearScanErrors

Method clearScanErrors

lib/model/folder.go:1232–1250  ·  view source on GitHub ↗
(subDirs []string)

Source from the content-addressed store, hash-verified

1230}
1231
1232func (f *folder) clearScanErrors(subDirs []string) {
1233 f.errorsMut.Lock()
1234 defer f.errorsMut.Unlock()
1235 if len(subDirs) == 0 {
1236 f.scanErrors = nil
1237 return
1238 }
1239 filtered := f.scanErrors[:0]
1240outer:
1241 for _, fe := range f.scanErrors {
1242 for _, sub := range subDirs {
1243 if fe.Path == sub || fs.IsParent(fe.Path, sub) {
1244 continue outer
1245 }
1246 }
1247 filtered = append(filtered, fe)
1248 }
1249 f.scanErrors = filtered
1250}
1251
1252func (f *folder) Errors() []FileError {
1253 f.errorsMut.Lock()

Callers 1

scanSubdirsMethod · 0.95

Calls 2

IsParentFunction · 0.92
UnlockMethod · 0.80

Tested by

no test coverage detected