Skip to content

Commit c83f0b7

Browse files
committed
commit compact only when there are updates
1 parent 1e979e8 commit c83f0b7

File tree

1 file changed

+11
-9
lines changed
  • turbopack/crates/turbo-persistence/src

1 file changed

+11
-9
lines changed

turbopack/crates/turbo-persistence/src/db.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,14 @@ impl TurboPersistence {
571571
)?;
572572
}
573573

574-
self.commit(
575-
new_sst_files,
576-
Vec::new(),
577-
indicies_to_delete,
578-
*sequence_number.get_mut(),
579-
)?;
574+
if !new_sst_files.is_empty() {
575+
self.commit(
576+
new_sst_files,
577+
Vec::new(),
578+
indicies_to_delete,
579+
*sequence_number.get_mut(),
580+
)?;
581+
}
580582

581583
self.active_write_operation.store(false, Ordering::Release);
582584

@@ -592,9 +594,9 @@ impl TurboPersistence {
592594
indicies_to_delete: &mut Vec<usize>,
593595
max_coverage: f32,
594596
max_merge_sequence: usize,
595-
) -> Result<bool> {
597+
) -> Result<()> {
596598
if static_sorted_files.is_empty() {
597-
return Ok(false);
599+
return Ok(());
598600
}
599601

600602
struct SstWithRange {
@@ -869,7 +871,7 @@ impl TurboPersistence {
869871
indicies_to_delete.append(&mut inner_indicies_to_delete);
870872
}
871873

872-
Ok(true)
874+
Ok(())
873875
}
874876

875877
/// Get a value from the database. Returns None if the key is not found. The returned value

0 commit comments

Comments
 (0)