Skip to content

Commit

Permalink
Do one compilation at the time
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx committed Sep 17, 2024
1 parent f345769 commit b50e75d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/services/upgradable-executor/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,10 @@ where
&self,
version: StateTransitionBytecodeVersion,
) -> ExecutorResult<wasmtime::Module> {
let guard = self.cached_modules.lock();
let mut guard = self.cached_modules.lock();
if let Some(module) = guard.get(&version) {
return Ok(module.clone());
}
drop(guard);

let view = StructuredStorage::new(
self.storage_view_provider
Expand All @@ -725,7 +724,7 @@ where
UpgradableError::ExecutorError(err) => err
})?;

self.cached_modules.lock().insert(version, module.clone());
guard.insert(version, module.clone());
Ok(module)
}
}
Expand Down

0 comments on commit b50e75d

Please sign in to comment.