Skip to content

Commit eeff5b4

Browse files
committed
fix: try to fix basic file inconsistency error again
The last attempt was incorrect due to scope issues.
1 parent c9f17ab commit eeff5b4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

rsync-fetcher/src/rsync/downloader.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,16 @@ impl Downloader {
134134
.open(&basis_path)
135135
.await?;
136136
let key = format!("{}{:x}", self.s3_prefix, entry.blake2b_hash.as_hex());
137-
match {
138-
let mut rd = self.s3.reader(&key).await?;
139-
tokio::io::copy(&mut rd, &mut basis_file).await?;
140-
Ok::<_, io::Error>(())
141-
} {
137+
let copy_result = {
138+
let basis_mut = &mut basis_file;
139+
async move {
140+
let mut rd = self.s3.reader(&key).await?;
141+
tokio::io::copy(&mut rd, basis_mut).await?;
142+
Ok::<_, io::Error>(())
143+
}
144+
}
145+
.await;
146+
match copy_result {
142147
Ok(()) => {}
143148
Err(e) if e.kind() == io::ErrorKind::NotFound => {
144149
warn!(

0 commit comments

Comments
 (0)