Skip to content

Commit e83da73

Browse files
committed
commit compact only when there are updates
1 parent de47dcf commit e83da73

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
@@ -573,12 +573,14 @@ impl TurboPersistence {
573573
)?;
574574
}
575575

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

583585
self.active_write_operation.store(false, Ordering::Release);
584586

@@ -594,9 +596,9 @@ impl TurboPersistence {
594596
indicies_to_delete: &mut Vec<usize>,
595597
max_coverage: f32,
596598
max_merge_sequence: usize,
597-
) -> Result<bool> {
599+
) -> Result<()> {
598600
if static_sorted_files.is_empty() {
599-
return Ok(false);
601+
return Ok(());
600602
}
601603

602604
struct SstWithRange {
@@ -871,7 +873,7 @@ impl TurboPersistence {
871873
indicies_to_delete.append(&mut inner_indicies_to_delete);
872874
}
873875

874-
Ok(true)
876+
Ok(())
875877
}
876878

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

0 commit comments

Comments
 (0)