mirror of
https://github.com/octoleo/syncthing.git
synced 2025-04-11 03:51:51 +00:00
Merge pull request #1955 from calmh/localver
Add version to LocalIndexUpdate event.
This commit is contained in:
commit
87811efc30
@ -1123,8 +1123,10 @@ func sendIndexTo(initial bool, minLocalVer int64, conn protocol.Connection, fold
|
|||||||
|
|
||||||
func (m *Model) updateLocals(folder string, fs []protocol.FileInfo) {
|
func (m *Model) updateLocals(folder string, fs []protocol.FileInfo) {
|
||||||
m.fmut.RLock()
|
m.fmut.RLock()
|
||||||
m.folderFiles[folder].Update(protocol.LocalDeviceID, fs)
|
files := m.folderFiles[folder]
|
||||||
m.fmut.RUnlock()
|
m.fmut.RUnlock()
|
||||||
|
files.Update(protocol.LocalDeviceID, fs)
|
||||||
|
|
||||||
m.rvmut.Lock()
|
m.rvmut.Lock()
|
||||||
for _, f := range fs {
|
for _, f := range fs {
|
||||||
delete(m.reqValidationCache, folder+"/"+f.Name)
|
delete(m.reqValidationCache, folder+"/"+f.Name)
|
||||||
@ -1134,6 +1136,7 @@ func (m *Model) updateLocals(folder string, fs []protocol.FileInfo) {
|
|||||||
events.Default.Log(events.LocalIndexUpdated, map[string]interface{}{
|
events.Default.Log(events.LocalIndexUpdated, map[string]interface{}{
|
||||||
"folder": folder,
|
"folder": folder,
|
||||||
"items": len(fs),
|
"items": len(fs),
|
||||||
|
"version": files.LocalVersion(protocol.LocalDeviceID),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user