Skip to content

Commit a41c989

Browse files
committed
add noop backing storage factory
1 parent 6ea5da8 commit a41c989

File tree

1 file changed

+7
-1
lines changed
  • turbopack/crates/turbo-tasks-backend/src

1 file changed

+7
-1
lines changed

turbopack/crates/turbo-tasks-backend/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use anyhow::Result;
1313

1414
pub use self::{backend::TurboTasksBackend, kv_backing_storage::KeyValueDatabaseBackingStorage};
1515
use crate::database::{
16-
handle_db_versioning, is_fresh, lmdb::LmbdKeyValueDatabase, FreshDbOptimization,
16+
handle_db_versioning, is_fresh, lmdb::LmbdKeyValueDatabase, FreshDbOptimization, NoopKvDb,
1717
ReadTransactionCache,
1818
};
1919

@@ -29,6 +29,12 @@ pub fn lmdb_backing_storage(path: &Path) -> Result<LmdbBackingStorage> {
2929
Ok(KeyValueDatabaseBackingStorage::new(database))
3030
}
3131

32+
pub type NoopBackingStorage = KeyValueDatabaseBackingStorage<NoopKvDb>;
33+
34+
pub fn noop_backing_storage(_path: &Path) -> Result<NoopBackingStorage> {
35+
Ok(KeyValueDatabaseBackingStorage::new(NoopKvDb::new()))
36+
}
37+
3238
pub type DefaultBackingStorage = LmdbBackingStorage;
3339

3440
pub fn default_backing_storage(path: &Path) -> Result<DefaultBackingStorage> {

0 commit comments

Comments
 (0)