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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user