fix(resume downloads): incorrect download percent on front end

Signed-off-by: Saarthak Verma <saarthakverma739@gmail.com>
This commit is contained in:
Saarthak Verma 2025-01-06 01:00:30 +05:30
parent 9966198289
commit 096a550079
No known key found for this signature in database
GPG key ID: 2BEFA9EF09A35950
2 changed files with 0 additions and 7 deletions

View file

@ -324,11 +324,6 @@ func (uri URI) DownloadFile(filePath, sha string, fileN, total int, downloadStat
return fmt.Errorf("failed to create / open file %q: %v", tmpFilePath, err)
}
defer outFile.Close()
outFileInfo, err := outFile.Stat()
if err != nil {
return fmt.Errorf("failed to get file info: %v", err)
}
fileSize := outFileInfo.Size()
hash, err := calculateHashForPartialFile(outFile)
if err != nil {
return fmt.Errorf("failed to calculate hash for partial file")
@ -339,7 +334,6 @@ func (uri URI) DownloadFile(filePath, sha string, fileN, total int, downloadStat
hash: hash,
fileNo: fileN,
totalFiles: total,
written: fileSize,
downloadStatus: downloadStatus,
}
_, err = io.Copy(io.MultiWriter(outFile, progress), resp.Body)

View file

@ -131,7 +131,6 @@ var _ = Describe("Download Test", func() {
err = os.Remove(filePath) // cleanup, also checks existance of filePath`
Expect(err).ToNot(HaveOccurred())
})
// It("it accurately updates progress")
// It("deletes partial file if after completion hash of downloaded file doesn't match hash of the file in the server")
})
})