mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
lib/model: Don't force rescan already changed items (#6798)
This commit is contained in:
parent
90e248615f
commit
0648fb0626
@ -953,9 +953,13 @@ func (f *folder) updateLocals(fs []protocol.FileInfo) {
|
||||
f.fset.Update(protocol.LocalDeviceID, fs)
|
||||
|
||||
filenames := make([]string, len(fs))
|
||||
f.forcedRescanPathsMut.Lock()
|
||||
for i, file := range fs {
|
||||
filenames[i] = file.Name
|
||||
// No need to rescan a file that was changed since anyway.
|
||||
delete(f.forcedRescanPaths, file.Name)
|
||||
}
|
||||
f.forcedRescanPathsMut.Unlock()
|
||||
|
||||
f.evLogger.Log(events.LocalIndexUpdated, map[string]interface{}{
|
||||
"folder": f.ID,
|
||||
@ -1005,6 +1009,9 @@ func (f *folder) handleForcedRescans() {
|
||||
}
|
||||
f.forcedRescanPaths = make(map[string]struct{})
|
||||
f.forcedRescanPathsMut.Unlock()
|
||||
if len(paths) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
batch := newFileInfoBatch(func(fs []protocol.FileInfo) error {
|
||||
f.fset.Update(protocol.LocalDeviceID, fs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user