mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-03 12:14:39 -06:00
Clear the loaded content after a snapshot has been verified
The snapshot content is loaded before verifying the snapshot, but after that it isn't used anymore so it should be released to save memory.
This commit is contained in:
@@ -381,6 +381,13 @@ func (manager *SnapshotManager) DownloadSnapshotContents(snapshot *Snapshot, pat
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ClearSnapshotContents removes contents loaded by DownloadSnapshotContents
|
||||||
|
func (manager *SnapshotManager) ClearSnapshotContents(snapshot *Snapshot) {
|
||||||
|
snapshot.ChunkHashes = nil
|
||||||
|
snapshot.ChunkLengths = nil
|
||||||
|
snapshot.Files = nil
|
||||||
|
}
|
||||||
|
|
||||||
// CleanSnapshotCache removes all files not referenced by the specified 'snapshot' in the snapshot cache.
|
// CleanSnapshotCache removes all files not referenced by the specified 'snapshot' in the snapshot cache.
|
||||||
func (manager *SnapshotManager) CleanSnapshotCache(latestSnapshot *Snapshot, allSnapshots map[string][]*Snapshot) bool {
|
func (manager *SnapshotManager) CleanSnapshotCache(latestSnapshot *Snapshot, allSnapshots map[string][]*Snapshot) bool {
|
||||||
|
|
||||||
@@ -906,6 +913,7 @@ func (manager *SnapshotManager) CheckSnapshots(snapshotID string, revisionsToChe
|
|||||||
if checkFiles {
|
if checkFiles {
|
||||||
manager.DownloadSnapshotContents(snapshot, nil, false)
|
manager.DownloadSnapshotContents(snapshot, nil, false)
|
||||||
manager.VerifySnapshot(snapshot)
|
manager.VerifySnapshot(snapshot)
|
||||||
|
manager.ClearSnapshotContents(snapshot)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user