File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -51,17 +51,16 @@ impl DnsCacheMiddleware {
5151 if cache_file. exists ( ) {
5252 cache. lock ( ) . await . load ( cache_file. as_path ( ) ) ;
5353 }
54- let mut interval =
55- tokio:: time:: interval ( Duration :: from_secs ( cache_checkpoint_time) ) ;
54+ let interval = Duration :: from_secs ( cache_checkpoint_time) ;
5655 loop {
5756 tokio:: select! {
58- _ = interval . tick ( ) => {
57+ _ = tokio :: time :: sleep ( interval ) => {
5958 cache. lock( ) . await . persist( cache_file. as_path( ) ) ;
60- log:: debug!( "save cache to {}" , cache_file. display( ) ) ;
59+ log:: debug!( "save DNS cache to file {}" , cache_file. display( ) ) ;
6160 }
6261 _ = crate :: signal:: terminate( ) => {
6362 cache. lock( ) . await . persist( cache_file. as_path( ) ) ;
64- log:: debug!( "save cache to {}" , cache_file. display( ) ) ;
63+ log:: debug!( "save DNS cache to file {}" , cache_file. display( ) ) ;
6564 break ;
6665 }
6766 } ;
You can’t perform that action at this time.
0 commit comments