Skip to content

Commit 7e1cdfc

Browse files
authored
Fix file deletion (#384)
This fixes a regression where data in stage location was not cleared after successful upload to S3 / Local persistant data location.
1 parent 972d987 commit 7e1cdfc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/storage/object_storage.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use relative_path::RelativePath;
4040
use relative_path::RelativePathBuf;
4141
use serde_json::Value;
4242

43-
use std::{collections::HashMap, path::Path, sync::Arc};
43+
use std::{collections::HashMap, fs, path::Path, sync::Arc};
4444

4545
// metadata file names in a Stream prefix
4646
pub(super) const STREAM_METADATA_FILE_NAME: &str = ".stream.json";
@@ -282,6 +282,8 @@ pub trait ObjectStorage: Sync + 'static {
282282
.entry(stream)
283283
.and_modify(|size| *size += compressed_size)
284284
.or_insert_with(|| compressed_size);
285+
286+
let _ = fs::remove_file(file);
285287
}
286288
}
287289

0 commit comments

Comments
 (0)