@@ -21,11 +21,11 @@ use std::{io, path::PathBuf};
2121use fs_extra:: file:: CopyOptions ;
2222use futures_util:: TryFutureExt ;
2323use hashlru:: Cache ;
24+ use human_size:: { Byte , Gigibyte , SpecificSize } ;
2425use itertools:: { Either , Itertools } ;
2526use object_store:: { local:: LocalFileSystem , ObjectStore } ;
2627use once_cell:: sync:: OnceCell ;
2728use tokio:: { fs, sync:: Mutex } ;
28- use human_size:: { SpecificSize , Gigibyte , Byte } ;
2929
3030use crate :: option:: CONFIG ;
3131
@@ -100,7 +100,7 @@ impl LocalCacheManager {
100100 pub async fn validate ( & self , config_capacity : u64 ) -> Result < ( ) , CacheError > {
101101 fs:: create_dir_all ( & self . cache_path ) . await ?;
102102 let path = cache_meta_path ( & self . cache_path )
103- . map_err ( |err| CacheError :: ObjectStoreError ( err. into ( ) ) ) ?;
103+ . map_err ( |err| CacheError :: ObjectStoreError ( err. into ( ) ) ) ?;
104104 let resp = self
105105 . filesystem
106106 . get ( & path)
@@ -112,8 +112,14 @@ impl LocalCacheManager {
112112 let mut meta: CacheMeta = serde_json:: from_slice ( & bytes) ?;
113113 if meta. size_capacity != config_capacity {
114114 // log the change in cache size
115- let configured_size_human: SpecificSize < Gigibyte > = SpecificSize :: new ( config_capacity as f64 , Byte ) . unwrap ( ) . into ( ) ;
116- let current_size_human: SpecificSize < Gigibyte > = SpecificSize :: new ( meta. size_capacity as f64 , Byte ) . unwrap ( ) . into ( ) ;
115+ let configured_size_human: SpecificSize < Gigibyte > =
116+ SpecificSize :: new ( config_capacity as f64 , Byte )
117+ . unwrap ( )
118+ . into ( ) ;
119+ let current_size_human: SpecificSize < Gigibyte > =
120+ SpecificSize :: new ( meta. size_capacity as f64 , Byte )
121+ . unwrap ( )
122+ . into ( ) ;
117123 log:: warn!(
118124 "Cache size is updated from {} to {}" ,
119125 current_size_human,
0 commit comments