Skip to content

Commit 7b8dca1

Browse files
author
Devdutt Shenoi
committed
file type is known
1 parent 224574a commit 7b8dca1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/parseable/streams.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,9 @@ impl Stream {
478478

479479
for file in &arrow_files {
480480
let file_size = file.metadata().unwrap().len();
481-
let file_type = file.extension().unwrap().to_str().unwrap();
482481

483482
metrics::STORAGE_SIZE
484-
.with_label_values(&["staging", &self.stream_name, file_type])
483+
.with_label_values(&["staging", &self.stream_name, ARROW_FILE_EXTENSION])
485484
.add(file_size as i64);
486485
}
487486

@@ -523,13 +522,12 @@ impl Stream {
523522
for file in arrow_files {
524523
// warn!("file-\n{file:?}\n");
525524
let file_size = file.metadata().unwrap().len();
526-
let file_type = file.extension().unwrap().to_str().unwrap();
527525
if remove_file(file.clone()).is_err() {
528526
error!("Failed to delete file. Unstable state");
529527
process::abort()
530528
}
531529
metrics::STORAGE_SIZE
532-
.with_label_values(&["staging", &self.stream_name, file_type])
530+
.with_label_values(&["staging", &self.stream_name, ARROW_FILE_EXTENSION])
533531
.sub(file_size as i64);
534532
}
535533
}

0 commit comments

Comments
 (0)