mirror of
https://github.com/syncthing/syncthing.git
synced 2026-05-18 13:52:00 -04:00
This reduces the number of file entries we carry in the database, sometimes significantly. The downside is that if a file is deleted while a device is offline, and that device comes back more than the cutoff interval (six months) later, those files will get resurrected at some point.
This commit is contained in:
@@ -251,6 +251,11 @@ func TryMigrateDatabase() error {
|
||||
return err
|
||||
}
|
||||
_ = snap.WithHaveSequence(0, func(fi protocol.FileInfo) bool {
|
||||
if fi.Deleted && time.Since(fi.ModTime()) > sqlite.MaxDeletedFileAge {
|
||||
// Skip deleted files that match the garbage collection
|
||||
// criteria in the database
|
||||
return true
|
||||
}
|
||||
fis <- fi
|
||||
return true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user