diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-04-09 19:49:43 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-04-09 19:49:43 -0700 |
commit | 46d328b6a18a7e60f9c1bd9037d0d86f136726e3 (patch) | |
tree | 8d65a65dfb790ead6e1dd4a4bf2521e3a65b7e61 | |
parent | 61e52b98a14ea493ea9fd3e7be84ca4e4d04b993 (diff) | |
download | fatcat-cli-46d328b6a18a7e60f9c1bd9037d0d86f136726e3.tar.gz fatcat-cli-46d328b6a18a7e60f9c1bd9037d0d86f136726e3.zip |
download: use threads for download-from-file same as stdin
-rw-r--r-- | fatcat-cli/src/download.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fatcat-cli/src/download.rs b/fatcat-cli/src/download.rs index 53c5a41..916f550 100644 --- a/fatcat-cli/src/download.rs +++ b/fatcat-cli/src/download.rs @@ -415,8 +415,12 @@ pub fn download_batch( let buffered = io::BufReader::new(input_file); let lines = buffered.lines(); for line in lines { - let json_str = line?; - download_entity(json_str, output_dir.clone(), show_progress)?; + let task = DownloadTask { + json_str: line?, + output_path: output_dir.clone(), + show_progress, + }; + task_sender.send(task)?; count += 1; if let Some(limit) = limit { if count >= limit { |