File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,9 @@ pub trait ObjectStorage: Sync + 'static {
246
246
. unwrap ( )
247
247
. get_mut ( & file)
248
248
. set_metadata ( CacheState :: Uploading ) ;
249
+
250
+ let compressed_size = file. metadata ( ) . map_or ( 0 , |meta| meta. len ( ) ) ;
251
+
249
252
let _put_parquet_file = self . upload_file ( & objectstore_path, & file) . await ?;
250
253
CACHED_FILES
251
254
. lock ( )
@@ -255,8 +258,8 @@ pub trait ObjectStorage: Sync + 'static {
255
258
256
259
stream_stats
257
260
. entry ( stream)
258
- . and_modify ( |size| * size += file . metadata ( ) . map_or ( 0 , |meta| meta . len ( ) ) )
259
- . or_insert_with ( || file . metadata ( ) . map_or ( 0 , |meta| meta . len ( ) ) ) ;
261
+ . and_modify ( |size| * size += compressed_size )
262
+ . or_insert_with ( || compressed_size ) ;
260
263
261
264
CACHED_FILES . lock ( ) . unwrap ( ) . remove ( & file) ;
262
265
}
You can’t perform that action at this time.
0 commit comments