File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -1014,16 +1014,28 @@ impl WasmChallengeExecutor {
10141014 }
10151015
10161016 pub fn module_exists ( & self , module_path : & str ) -> bool {
1017- // Check filesystem first
1017+ // Check module cache first
1018+ if self . module_cache . read ( ) . contains_key ( module_path) {
1019+ return true ;
1020+ }
1021+ // Check filesystem
1022+ self . resolve_module_path ( module_path) . exists ( )
1023+ }
1024+
1025+ /// Async version that also checks distributed storage
1026+ pub async fn module_exists_async ( & self , module_path : & str ) -> bool {
1027+ // Check module cache first
1028+ if self . module_cache . read ( ) . contains_key ( module_path) {
1029+ return true ;
1030+ }
1031+ // Check filesystem
10181032 if self . resolve_module_path ( module_path) . exists ( ) {
10191033 return true ;
10201034 }
10211035 // Check distributed storage
10221036 if let Some ( ref storage) = self . config . distributed_storage {
10231037 let key = platform_distributed_storage:: StorageKey :: new ( "wasm" , module_path) ;
1024- if let Ok ( exists) = tokio:: task:: block_in_place ( || {
1025- tokio:: runtime:: Handle :: current ( ) . block_on ( storage. exists ( & key) )
1026- } ) {
1038+ if let Ok ( exists) = storage. exists ( & key) . await {
10271039 return exists;
10281040 }
10291041 }
You can’t perform that action at this time.
0 commit comments