(a: Aggregation)
| 57 | } |
| 58 | |
| 59 | fn 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 | |
| 68 | fn get_key(name: &str, a: Aggregation, dt: NaiveDateTime) -> String { |
| 69 | redis_key(format!( |
no outgoing calls
no test coverage detected