This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make client.downloader to download large file to file
The current implementation will download the whole file into memory and will crash when the file is too large. This patch will fix this issue by: - download larger file (>4M) to a temp file on disk, and rename it to `self.filename` on `self._write_to_file()` - download smaller file to memory, but to a list of blocks the `self.file_binary_data += block` has performace issue - do checksuming while downloading, most CPU can calculate the checksum faster than download speed, this saves a full reading from disk for larger files
- Loading branch information
Showing
1 changed file
with
72 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters