Skip to content

Commit

Permalink
It's hard to track..
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil committed Jan 7, 2025
1 parent be46fb3 commit 5cd51ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/api/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,14 +674,20 @@ impl ApiRepo {
}
}
println!("Truncating file {filename:?} to {length}");
let mut f = tokio::fs::OpenOptions::new()
let f = tokio::fs::OpenOptions::new()
.write(true)
.open(&filename)
.await?;
f
.set_len(length as u64)
.await?;
f.sync_all().await?;
let metadata = tokio::fs::OpenOptions::new()
.write(true)
.open(&filename)
.await?.metadata().await?;
assert_eq!(metadata.len(), length as u64);

println!("Truncated file {filename:?} to {length}");
progressbar.finish().await;
Ok(filename)
Expand Down

0 comments on commit 5cd51ce

Please sign in to comment.