1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-18 09:13:17 +00:00

Disable caching when retriving files in SnapshotManager

This commit is contained in:
Gilbert Chen
2017-11-27 23:36:09 -05:00
parent 7a7ea3ad18
commit 6f69aff712

View File

@@ -1113,6 +1113,14 @@ func (manager *SnapshotManager) RetrieveFile(snapshot *Snapshot, file *Entry, ou
manager.CreateChunkDownloader()
// Temporarily disable the snapshot cache of the download so that downloaded file chunks won't be saved
// to the cache.
snapshotCache := manager.chunkDownloader.snapshotCache
manager.chunkDownloader.snapshotCache = nil
defer func() {
manager.chunkDownloader.snapshotCache = snapshotCache
}()
fileHasher := manager.config.NewFileHasher()
alternateHash := false
if strings.HasPrefix(file.Hash, "#") {