From 048a50f772d89d5c3d238c750f045f89fcfea40d Mon Sep 17 00:00:00 2001 From: Dominik Werder Date: Thu, 27 Feb 2025 16:01:45 +0100 Subject: [PATCH] Add conversion to numeric index --- src/ttl.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ttl.rs b/src/ttl.rs index f3f7d77..61710cf 100644 --- a/src/ttl.rs +++ b/src/ttl.rs @@ -66,6 +66,14 @@ impl RetentionTime { // Current choice is to keep the TTL the same as for events self.ttl_events_d0() } + + pub fn index_db_i32(&self) -> i32 { + match self { + RetentionTime::Short => 2, + RetentionTime::Medium => 4, + RetentionTime::Long => 12, + } + } } impl fmt::Display for RetentionTime {