1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-11 05:43:23 +00:00

Comments from @gilbertchen, thanks.

This commit is contained in:
niknah
2017-09-18 01:38:51 +10:00
parent f74ea0368e
commit f25783d59d
2 changed files with 7 additions and 14 deletions

View File

@@ -2217,11 +2217,9 @@ func (manager *SnapshotManager) DownloadFile(path string, derivationKey string)
return nil
}
if !manager.config.dryRun {
err = manager.snapshotCache.UploadFile(0, path, manager.fileChunk.GetBytes())
if err != nil {
LOG_WARN("DOWNLOAD_FILE_CACHE", "Failed to add the file %s to the snapshot cache: %v", path, err)
}
err = manager.snapshotCache.UploadFile(0, path, manager.fileChunk.GetBytes())
if err != nil {
LOG_WARN("DOWNLOAD_FILE_CACHE", "Failed to add the file %s to the snapshot cache: %v", path, err)
}
LOG_DEBUG("DOWNLOAD_FILE", "Downloaded file %s", path)
@@ -2231,9 +2229,6 @@ func (manager *SnapshotManager) DownloadFile(path string, derivationKey string)
// UploadFile uploads a non-chunk file from the storage.
func (manager *SnapshotManager) UploadFile(path string, derivationKey string, content []byte) bool {
if manager.config.dryRun {
return true
}
manager.fileChunk.Reset(false)
manager.fileChunk.Write(content)