MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / get_ttl

Function get_ttl

chirpstack/src/storage/metrics.rs:59–66  ·  view source on GitHub ↗
(a: Aggregation)

Source from the content-addressed store, hash-verified

57}
58
59fn get_ttl(a: Aggregation) -> Duration {
60 match a {
61 Aggregation::MINUTE => Duration::from_secs(60 * 60 * 2), // two hours
62 Aggregation::HOUR => Duration::from_secs(60 * 60 * 24 * 2), // two days
63 Aggregation::DAY => Duration::from_secs(60 * 60 * 24 * 31 * 2), // two months
64 Aggregation::MONTH => Duration::from_secs(60 * 60 * 24 * 365 * 2), // two years
65 }
66}
67
68fn get_key(name: &str, a: Aggregation, dt: NaiveDateTime) -> String {
69 redis_key(format!(

Callers 2

save_stateFunction · 0.85
saveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected