Skip to content

Commit

Permalink
Add sync for files. (#45)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Kirilin <[email protected]>
  • Loading branch information
s3rius authored Feb 24, 2022
1 parent 17464c5 commit 9cac6a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ httptest = "0.15.4"
[profile.release]
lto = true
panic = "abort"
opt-level = 2
opt-level = 3
codegen-units = 1
1 change: 1 addition & 0 deletions src/info_storages/file_info_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl InfoStorage for FileInfoStorage {
err
})?;
copy(&mut data.as_bytes(), &mut file).await?;
file.sync_data().await?;
Ok(())
}

Expand Down
1 change: 1 addition & 0 deletions src/storages/file_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ impl Storage for FileStorage {
})?;
let mut reader = BufReader::new(bytes);
copy(&mut reader, &mut file).await?;
file.sync_data().await?;
Ok(())
}

Expand Down

0 comments on commit 9cac6a6

Please sign in to comment.