all: Add invalid/ignored files to global list, announce to peers (fixes #623)
This lets us determine accurate completion status for remote peers when they have ignored files. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4460
This commit is contained in:
@@ -761,6 +761,17 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
|
||||
// Converts old symlink types to new in the entire database.
|
||||
ldb.ConvertSymlinkTypes()
|
||||
}
|
||||
if cfg.RawCopy().OriginalVersion < 26 {
|
||||
// Adds invalid (ignored) files to global list of files
|
||||
changed := 0
|
||||
for folderID, folderCfg := range folders {
|
||||
changed += ldb.AddInvalidToGlobal([]byte(folderID), protocol.LocalDeviceID[:])
|
||||
for _, deviceCfg := range folderCfg.Devices {
|
||||
changed += ldb.AddInvalidToGlobal([]byte(folderID), deviceCfg.DeviceID[:])
|
||||
}
|
||||
}
|
||||
l.Infof("Database update: Added %d ignored files to the global list", changed)
|
||||
}
|
||||
|
||||
m := model.NewModel(cfg, myID, "syncthing", Version, ldb, protectedFiles)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user