MCPcopy
hub / github.com/syncthing/syncthing / localIndexUpdate

Function localIndexUpdate

lib/model/testutils_test.go:277–294  ·  view source on GitHub ↗
(m *testModel, folder string, fs []protocol.FileInfo)

Source from the content-addressed store, hash-verified

275}
276
277func localIndexUpdate(m *testModel, folder string, fs []protocol.FileInfo) {
278 m.sdb.Update(folder, protocol.LocalDeviceID, fs)
279 seq, err := m.sdb.GetDeviceSequence(folder, protocol.LocalDeviceID)
280 if err != nil {
281 panic(err)
282 }
283 filenames := make([]string, len(fs))
284 for i, file := range fs {
285 filenames[i] = file.Name
286 }
287 m.evLogger.Log(events.LocalIndexUpdated, map[string]interface{}{
288 "folder": folder,
289 "items": len(fs),
290 "filenames": filenames,
291 "sequence": seq,
292 "version": seq, // legacy for sequence
293 })
294}
295
296func newDeviceConfiguration(defaultCfg config.DeviceConfiguration, id protocol.DeviceID, name string) config.DeviceConfiguration {
297 cfg := defaultCfg.Copy()

Callers 1

Calls 3

UpdateMethod · 0.65
GetDeviceSequenceMethod · 0.65
LogMethod · 0.65

Tested by

no test coverage detected