From 2227984b4b0eb31ab5ebc5a2892e5e91fa325010 Mon Sep 17 00:00:00 2001 From: Satyam Singh Date: Thu, 27 Apr 2023 13:10:47 +0530 Subject: [PATCH] Fix file deletion --- server/src/storage/object_storage.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/storage/object_storage.rs b/server/src/storage/object_storage.rs index 2b31fe04f..ea920378f 100644 --- a/server/src/storage/object_storage.rs +++ b/server/src/storage/object_storage.rs @@ -40,7 +40,7 @@ use relative_path::RelativePath; use relative_path::RelativePathBuf; use serde_json::Value; -use std::{collections::HashMap, path::Path, sync::Arc}; +use std::{collections::HashMap, fs, path::Path, sync::Arc}; // metadata file names in a Stream prefix pub(super) const STREAM_METADATA_FILE_NAME: &str = ".stream.json"; @@ -282,6 +282,8 @@ pub trait ObjectStorage: Sync + 'static { .entry(stream) .and_modify(|size| *size += compressed_size) .or_insert_with(|| compressed_size); + + let _ = fs::remove_file(file); } }