diff options
| author | 2025-03-04 11:32:03 -0600 | |
|---|---|---|
| committer | 2025-03-04 11:32:03 -0600 | |
| commit | f4ff42d821c36aada722988229d67f0c1f075b1f (patch) | |
| tree | 127771497230f08b15ee56f2a882f4d5a2c7adab | |
| parent | remove old code for strsub (diff) | |
concurrently prepare files for download
| -rw-r--r-- | ozone/src/launcher/download.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ozone/src/launcher/download.rs b/ozone/src/launcher/download.rs index 036537d..6e32e26 100644 --- a/ozone/src/launcher/download.rs +++ b/ozone/src/launcher/download.rs @@ -129,16 +129,13 @@ where } stream::iter(self.jobs.map(Ok)) - .try_filter_map(move |job_| async move { + .try_for_each_concurrent(self.nconcurrent, |job_| async move { let job = job_.borrow_mut(); + let Some(rq) = map_err!(job.prepare(client).await, Phase::Prepare, job) else { - return Ok(None); + return Ok(()); }; - - Ok(Some((job_, rq))) - }) - .try_for_each_concurrent(self.nconcurrent, move |(job_, rq)| async move { - let job = job_.borrow_mut(); + let mut data = map_err!(map_err!(rq.send().await, Phase::Send, job).error_for_status(), Phase::Send, job).bytes_stream(); while let Some(bytes) = data.next().await { |
