Skip to content

Commit

Permalink
fix: avoid removal of retention configuration while updating snapshot (
Browse files Browse the repository at this point in the history
…#661)

fixes #654
  • Loading branch information
gurjotkaur20 authored Feb 17, 2024
1 parent 68aa486 commit 121bf01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub use store_metadata::{
put_remote_metadata, put_staging_metadata, resolve_parseable_metadata, StorageMetadata,
};

use self::retention::Retention;
pub use self::staging::StorageDir;

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

#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
Expand Down Expand Up @@ -118,6 +120,7 @@ impl Default for ObjectStoreFormat {
stats: Stats::default(),
snapshot: Snapshot::default(),
cache_enabled: false,
retention: Retention::new(),
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions server/src/storage/retention.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ struct TaskView {
duration: String,
}

impl Retention {
pub fn new() -> Self {
Self { tasks: Vec::new() }
}
}

impl TryFrom<Vec<TaskView>> for Retention {
type Error = String;

Expand Down

0 comments on commit 121bf01

Please sign in to comment.