Skip to content

Commit

Permalink
toggle another directory-fsync on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Dec 9, 2023
1 parent b12f1e9 commit e02ecd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/flush.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,12 @@ pub fn start(tree: &Tree) -> crate::Result<std::thread::JoinHandle<crate::Result
let marker = File::create(old_journal_folder.join(".flush"))?;
marker.sync_all()?;

let folder = File::open(&old_journal_folder)?;
folder.sync_all()?;
#[cfg(not(target_os = "windows"))]
{
// Fsync folder on Windows
let folder = File::open(&old_journal_folder)?;
folder.sync_all()?;
}

let new_journal_path = tree
.config
Expand Down
2 changes: 1 addition & 1 deletion tests/block_cache_share.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tempfile::tempdir;
use test_log::test;

#[test]
fn tree_flushed_count() -> lsm_tree::Result<()> {
fn test_share_block_cache() -> lsm_tree::Result<()> {
let block_cache = Arc::new(BlockCache::with_capacity_blocks(10_000));

let folder = tempdir()?.into_path();
Expand Down

0 comments on commit e02ecd0

Please sign in to comment.