File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use std::path::Path;
22use std:: time:: Duration ;
33
44use moka:: future:: { Cache as MokaCache , CacheBuilder } ;
5+ use tracing:: trace;
56
67use crate :: drive:: AliyunFile ;
78
@@ -20,15 +21,18 @@ impl Cache {
2021
2122 #[ allow( clippy:: ptr_arg) ]
2223 pub fn get ( & self , key : & String ) -> Option < Vec < AliyunFile > > {
24+ trace ! ( key = %key, "cache: get" ) ;
2325 self . inner . get ( key)
2426 }
2527
2628 pub async fn insert ( & self , key : String , value : Vec < AliyunFile > ) {
29+ trace ! ( key = %key, "cache: insert" ) ;
2730 self . inner . insert ( key, value) . await ;
2831 }
2932
3033 pub async fn invalidate ( & self , path : & Path ) {
3134 let key = path. to_string_lossy ( ) . into_owned ( ) ;
35+ trace ! ( path = %path. display( ) , key = %key, "cache: invalidate" ) ;
3236 self . inner . invalidate ( & key) . await ;
3337 }
3438
@@ -39,6 +43,7 @@ impl Cache {
3943 }
4044
4145 pub fn invalidate_all ( & self ) {
46+ trace ! ( "cache: invalidate all" ) ;
4247 self . inner . invalidate_all ( ) ;
4348 }
4449}
You can’t perform that action at this time.
0 commit comments