We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5878d20 commit bbf21ccCopy full SHA for bbf21cc
turbopack/crates/turbo-tasks-backend/src/kv_backing_storage.rs
@@ -466,8 +466,11 @@ impl<T: KeyValueDatabase + Send + Sync + 'static> BackingStorage
466
}
467
468
fn invalidate(&self) -> Result<()> {
469
+ // `base_path` can be `None` for a `NoopKvDb`
470
if let Some(base_path) = &self.base_path {
- // `base_path` can be `None` for a `NoopKvDb`
471
+ // Invalidate first, as it's a very fast atomic operation. `prevent_writes` is allowed
472
+ // to be slower (e.g. wait for a lock) and is allowed to corrupt the database with
473
+ // partial writes.
474
invalidate_db(base_path)?;
475
self.database.prevent_writes()
476
0 commit comments