diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2024-05-29 14:38:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-29 18:38:18 +0000 |
| commit | 94f040ac2867706d261e2fe1ec8bc2c4263eb6ab (patch) | |
| tree | 5eaed4d41efd8d25da839bc29b8d32554e1a0fca /cli/node.rs | |
| parent | fada25b0dd593efee496dabb48ed9cb7a9cb6647 (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/node.rs')
| -rw-r--r-- | cli/node.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/node.rs b/cli/node.rs index bc6a572a5..4c285e3f4 100644 --- a/cli/node.rs +++ b/cli/node.rs @@ -13,6 +13,7 @@ use deno_runtime::deno_node::analyze::NodeCodeTranslator; use serde::Deserialize; use serde::Serialize; +use crate::cache::CacheDBHash; use crate::cache::NodeAnalysisCache; use crate::util::fs::canonicalize_path_maybe_not_exists; @@ -63,10 +64,9 @@ impl CliCjsCodeAnalyzer { specifier: &ModuleSpecifier, source: &str, ) -> Result<CliCjsAnalysis, AnyError> { - let source_hash = NodeAnalysisCache::compute_source_hash(source); - if let Some(analysis) = self - .cache - .get_cjs_analysis(specifier.as_str(), &source_hash) + let source_hash = CacheDBHash::from_source(source); + if let Some(analysis) = + self.cache.get_cjs_analysis(specifier.as_str(), source_hash) { return Ok(analysis); } @@ -107,7 +107,7 @@ impl CliCjsCodeAnalyzer { self .cache - .set_cjs_analysis(specifier.as_str(), &source_hash, &analysis); + .set_cjs_analysis(specifier.as_str(), source_hash, &analysis); Ok(analysis) } |
