Skip to content

Commit f83bc65

Browse files
committed
Turbopack: do not run a compaction when opening the db
1 parent 0027940 commit f83bc65

File tree

1 file changed

+2
-14
lines changed
  • turbopack/crates/turbo-tasks-backend/src/database/turbo

1 file changed

+2
-14
lines changed

turbopack/crates/turbo-tasks-backend/src/database/turbo/mod.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,12 @@ pub struct TurboKeyValueDatabase {
3737
impl TurboKeyValueDatabase {
3838
pub fn new(versioned_path: PathBuf, is_ci: bool, is_short_session: bool) -> Result<Self> {
3939
let db = Arc::new(TurboPersistence::open(versioned_path)?);
40-
let mut this = Self {
40+
Ok(Self {
4141
db: db.clone(),
4242
compact_join_handle: Mutex::new(None),
4343
is_ci,
4444
is_short_session,
45-
};
46-
// start compaction in background if the database is not empty
47-
if !db.is_empty() {
48-
let handle = spawn(async move {
49-
db.compact(&CompactConfig {
50-
max_merge_segment_count: available_parallelism()
51-
.map_or(4, |c| max(4, c.get() / 4)),
52-
..COMPACT_CONFIG
53-
})
54-
});
55-
this.compact_join_handle.get_mut().replace(handle);
56-
}
57-
Ok(this)
45+
})
5846
}
5947
}
6048

0 commit comments

Comments
 (0)