summaryrefslogtreecommitdiff
path: root/cli/module_loader.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-05-29 14:38:18 -0400
committerGitHub <noreply@github.com>2024-05-29 18:38:18 +0000
commit94f040ac2867706d261e2fe1ec8bc2c4263eb6ab (patch)
tree5eaed4d41efd8d25da839bc29b8d32554e1a0fca /cli/module_loader.rs
parentfada25b0dd593efee496dabb48ed9cb7a9cb6647 (diff)
fix: bump cache sqlite dbs to v2 for WAL journal mode change (#24030)
In https://github.com/denoland/deno/pull/23955 we changed the sqlite db journal mode to WAL. This causes issues when someone is running an old version of Deno using TRUNCATE and a new version because the two fight against each other.
Diffstat (limited to 'cli/module_loader.rs')
-rw-r--r--cli/module_loader.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/module_loader.rs b/cli/module_loader.rs
index 593868687..91227802a 100644
--- a/cli/module_loader.rs
+++ b/cli/module_loader.rs
@@ -382,7 +382,9 @@ impl<TGraphContainer: ModuleGraphContainer>
let code_cache = if module_type == ModuleType::JavaScript {
self.shared.code_cache.as_ref().map(|cache| {
- let code_hash = FastInsecureHasher::hash(&code);
+ let code_hash = FastInsecureHasher::new_deno_versioned()
+ .write_hashable(&code)
+ .finish();
let data = cache
.get_sync(specifier, code_cache::CodeCacheType::EsModule, code_hash)
.map(Cow::from)