@@ -38,13 +38,13 @@ impl Cache {
3838 }
3939 }
4040
41- fn find ( & self , path : & ContentPath ) -> Option < Vec < u8 > > {
41+ async fn find ( & self , path : & ContentPath ) -> Option < Vec < u8 > > {
4242 match self {
4343 Cache :: Memory { cache } => cache. lock ( ) . unwrap ( ) . get ( path) . cloned ( ) ,
4444 }
4545 }
4646
47- fn insert ( & self , path : ContentPath , data : Vec < u8 > ) {
47+ async fn insert ( & self , path : ContentPath , data : Vec < u8 > ) {
4848 match self {
4949 Cache :: Memory { cache } => {
5050 let mut cache = cache. lock ( ) . unwrap ( ) ;
@@ -111,7 +111,7 @@ impl LinkResolverTrait for IpfsResolver {
111111 let max_file_size = self . max_file_size ;
112112 let max_cache_file_size = self . max_cache_file_size ;
113113
114- if let Some ( data) = self . cache . find ( & path) {
114+ if let Some ( data) = self . cache . find ( & path) . await {
115115 trace ! ( logger, "IPFS cat cache hit" ; "hash" => path. to_string( ) ) ;
116116 return Ok ( data. to_owned ( ) ) ;
117117 }
@@ -132,7 +132,7 @@ impl LinkResolverTrait for IpfsResolver {
132132 . to_vec ( ) ;
133133
134134 if data. len ( ) <= max_cache_file_size {
135- self . cache . insert ( path. clone ( ) , data. clone ( ) ) ;
135+ self . cache . insert ( path. clone ( ) , data. clone ( ) ) . await ;
136136 } else {
137137 debug ! (
138138 logger,
0 commit comments