1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-07-27 17:28:36 +00:00
This commit is contained in:
Matthias Ahouansou 2024-07-10 09:44:44 +01:00
parent bf902f1607
commit ab21c5dbef
No known key found for this signature in database
5 changed files with 28 additions and 101 deletions

View file

@ -117,6 +117,8 @@ pub enum Restriction {
#[derive(Deserialize, Clone, Copy, Debug)]
#[serde(rename_all = "snake_case")]
// When deserializing, we want this prefix
#[allow(clippy::enum_variant_names)]
pub enum Timeframe {
PerSecond(NonZeroU64),
PerMinute(NonZeroU64),
@ -141,8 +143,6 @@ pub struct Limitation {
pub timeframe: Timeframe,
#[serde(default = "default_non_zero")]
pub burst_capacity: NonZeroU64,
#[serde(default = "default_non_zero")]
pub weight: NonZeroU64,
}
const DEPRECATED_KEYS: &[&str] = &["cache_capacity"];
@ -362,7 +362,6 @@ pub fn default_rate_limit() -> BTreeMap<Restriction, Limitation> {
Limitation {
timeframe: Timeframe::PerMinute(NonZeroU64::MIN),
burst_capacity: NonZeroU64::MIN,
weight: NonZeroU64::MIN,
},
)])
}