diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-04-09 19:50:04 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-04-09 19:50:04 -0700 |
commit | 03eb688bc2173748f2180af69b7f3b3fd7853299 (patch) | |
tree | 866a836122e58b027a4d7d9d8cfeeeecb9b726cf | |
parent | 46d328b6a18a7e60f9c1bd9037d0d86f136726e3 (diff) | |
download | fatcat-cli-03eb688bc2173748f2180af69b7f3b3fd7853299.tar.gz fatcat-cli-03eb688bc2173748f2180af69b7f3b3fd7853299.zip |
download: fix concurrency bug at end of batch download
-rw-r--r-- | fatcat-cli/src/download.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fatcat-cli/src/download.rs b/fatcat-cli/src/download.rs index 916f550..d415e58 100644 --- a/fatcat-cli/src/download.rs +++ b/fatcat-cli/src/download.rs @@ -340,6 +340,7 @@ fn loop_printer( for line in output_receiver { println!("{}", line); } + done_sender.send(())?; drop(done_sender); Ok(()) } @@ -354,6 +355,7 @@ fn loop_download_tasks( download_entity(task.json_str, task.output_path, task.show_progress)?; output_sender.send(status_line)?; } + drop(output_sender); Ok(()) })(); if let Err(ref e) = thread_result { @@ -430,6 +432,7 @@ pub fn download_batch( } } }; + drop(task_sender); done_receiver.recv()?; Ok(count) } |