File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ impl<T: AsyncFromStrWithState> FileCache<T> {
7979 log:: trace!( "Cache answer without filesystem lookup for {:?}" , path) ;
8080 return Ok ( Arc :: clone ( & cached. content ) ) ;
8181 }
82- if let Ok ( modified) = std :: fs:: metadata ( path) . and_then ( |m| m. modified ( ) ) {
82+ if let Ok ( modified) = tokio :: fs:: metadata ( path) . await . and_then ( |m| m. modified ( ) ) {
8383 if modified <= cached. last_check_time ( ) {
8484 log:: trace!( "Cache answer with filesystem metadata read for {:?}" , path) ;
8585 cached. update_check_time ( ) ;
@@ -89,7 +89,8 @@ impl<T: AsyncFromStrWithState> FileCache<T> {
8989 }
9090 // Read lock is released
9191 log:: trace!( "Loading and parsing {:?}" , path) ;
92- let file_contents = std:: fs:: read_to_string ( path)
92+ let file_contents = tokio:: fs:: read_to_string ( path)
93+ . await
9394 . with_context ( || format ! ( "Reading {path:?} to load it in cache" ) ) ;
9495 let parsed = match file_contents {
9596 Ok ( contents) => Ok ( T :: from_str_with_state ( app_state, & contents) . await ?) ,
You can’t perform that action at this time.
0 commit comments