Skip to content

Commit 121bf01

Browse files
authored
fix: avoid removal of retention configuration while updating snapshot (#661)
fixes #654
1 parent 68aa486 commit 121bf01

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

server/src/storage.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub use store_metadata::{
3737
put_remote_metadata, put_staging_metadata, resolve_parseable_metadata, StorageMetadata,
3838
};
3939

40+
use self::retention::Retention;
4041
pub use self::staging::StorageDir;
4142

4243
/// local sync interval to move data.records to /tmp dir of that stream.
@@ -76,6 +77,7 @@ pub struct ObjectStoreFormat {
7677
pub snapshot: Snapshot,
7778
#[serde(default)]
7879
pub cache_enabled: bool,
80+
pub retention: Retention,
7981
}
8082

8183
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
@@ -118,6 +120,7 @@ impl Default for ObjectStoreFormat {
118120
stats: Stats::default(),
119121
snapshot: Snapshot::default(),
120122
cache_enabled: false,
123+
retention: Retention::new(),
121124
}
122125
}
123126
}

server/src/storage/retention.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ struct TaskView {
128128
duration: String,
129129
}
130130

131+
impl Retention {
132+
pub fn new() -> Self {
133+
Self { tasks: Vec::new() }
134+
}
135+
}
136+
131137
impl TryFrom<Vec<TaskView>> for Retention {
132138
type Error = String;
133139

0 commit comments

Comments
 (0)