Skip to content

Commit 45fad6a

Browse files
authored
chore(compile): log code cache file path (#26977)
Ref #26976
1 parent 8f7787f commit 45fad6a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cli/standalone/code_cache.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ impl DenoCompileCodeCache {
4242
// attempt to deserialize the cache data
4343
match deserialize(&file_path, cache_key) {
4444
Ok(data) => {
45-
log::debug!("Loaded {} code cache entries", data.len());
45+
log::debug!(
46+
"Loaded {} code cache entries from {}",
47+
data.len(),
48+
file_path.display()
49+
);
4650
Self {
4751
strategy: CodeCacheStrategy::SubsequentRun(
4852
SubsequentRunCodeCacheStrategy {
@@ -53,7 +57,11 @@ impl DenoCompileCodeCache {
5357
}
5458
}
5559
Err(err) => {
56-
log::debug!("Failed to deserialize code cache: {:#}", err);
60+
log::debug!(
61+
"Failed to deserialize code cache from {}: {:#}",
62+
file_path.display(),
63+
err
64+
);
5765
Self {
5866
strategy: CodeCacheStrategy::FirstRun(FirstRunCodeCacheStrategy {
5967
cache_key,
@@ -186,6 +194,7 @@ impl FirstRunCodeCacheStrategy {
186194
Ok(()) => {
187195
if let Err(err) = std::fs::rename(&temp_file, &self.file_path) {
188196
log::debug!("Failed to rename code cache: {}", err);
197+
let _ = std::fs::remove_file(&temp_file);
189198
} else {
190199
log::debug!("Serialized {} code cache entries", count);
191200
}

0 commit comments

Comments
 (0)