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.
2 parents 5376331 + 8e7f515 commit ef3998bCopy full SHA for ef3998b
1 file changed
crates/loader/src/cache.rs
@@ -50,7 +50,14 @@ impl Cache {
50
51
/// Return the path to a wasm file given its digest.
52
pub fn wasm_file(&self, digest: impl AsRef<str>) -> Result<PathBuf> {
53
- let path = self.wasm_path(&digest);
+ // Check the expected wasm directory first; else check the data directory as a fallback.
54
+ // (Layers with unknown media types are currently saved to the data directory in client.pull())
55
+ // This adds a bit of futureproofing for fetching wasm layers with different/updated media types
56
+ // (see WASM_LAYER_MEDIA_TYPE, which is subject to change in future versions).
57
+ let mut path = self.wasm_path(&digest);
58
+ if !path.exists() {
59
+ path = self.data_path(&digest);
60
+ }
61
ensure!(
62
path.exists(),
63
"cannot find wasm file for digest {}",
0 commit comments