Skip to content

Commit

Permalink
Tokio needs sync ?
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil committed Jan 7, 2025
1 parent ed37a90 commit be46fb3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/api/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,14 @@ impl ApiRepo {
}
}
println!("Truncating file {filename:?} to {length}");
tokio::fs::OpenOptions::new()
let mut f = tokio::fs::OpenOptions::new()
.write(true)
.open(&filename)
.await?
.await?;
f
.set_len(length as u64)
.await?;
f.sync_all().await?;
println!("Truncated file {filename:?} to {length}");
progressbar.finish().await;
Ok(filename)
Expand Down

0 comments on commit be46fb3

Please sign in to comment.