Skip to content

Commit 2209eb2

Browse files
authored
allow set retention after creation (#105)
1 parent 2f59589 commit 2209eb2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,13 @@ impl Wal {
539539
}
540540
Ok(())
541541
}
542+
543+
/// Set how many segments closed segments to retain on prefix truncation.
544+
///
545+
/// Can't be less than 1. If 0 is provided, it will be set to 1.
546+
pub fn set_retention(&mut self, retain_closed: usize) {
547+
self.retain_closed = NonZeroUsize::new(retain_closed.max(1)).unwrap();
548+
}
542549
}
543550

544551
impl fmt::Debug for Wal {

0 commit comments

Comments
 (0)