diff --git a/Cargo.toml b/Cargo.toml index e6dfa2e..d634cad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -113,5 +113,5 @@ httptest = "0.15.4" [profile.release] lto = true panic = "abort" -opt-level = 2 +opt-level = 3 codegen-units = 1 diff --git a/src/info_storages/file_info_storage.rs b/src/info_storages/file_info_storage.rs index 993f312..fad265b 100644 --- a/src/info_storages/file_info_storage.rs +++ b/src/info_storages/file_info_storage.rs @@ -50,6 +50,7 @@ impl InfoStorage for FileInfoStorage { err })?; copy(&mut data.as_bytes(), &mut file).await?; + file.sync_data().await?; Ok(()) } diff --git a/src/storages/file_storage.rs b/src/storages/file_storage.rs index a89985a..2653412 100644 --- a/src/storages/file_storage.rs +++ b/src/storages/file_storage.rs @@ -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(()) }