You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-31 09:24:31 +03:00
Fix sentry transport post-upgrade
This commit is contained in:
@ -14,7 +14,6 @@ pub struct RateLimiter {
|
|||||||
session: Option<SystemTime>,
|
session: Option<SystemTime>,
|
||||||
transaction: Option<SystemTime>,
|
transaction: Option<SystemTime>,
|
||||||
attachment: Option<SystemTime>,
|
attachment: Option<SystemTime>,
|
||||||
profile: Option<SystemTime>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RateLimiter {
|
impl RateLimiter {
|
||||||
@ -60,7 +59,6 @@ impl RateLimiter {
|
|||||||
"session" => self.session = new_time,
|
"session" => self.session = new_time,
|
||||||
"transaction" => self.transaction = new_time,
|
"transaction" => self.transaction = new_time,
|
||||||
"attachment" => self.attachment = new_time,
|
"attachment" => self.attachment = new_time,
|
||||||
"profile" => self.profile = new_time,
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,7 +93,6 @@ impl RateLimiter {
|
|||||||
RateLimitingCategory::Session => self.session,
|
RateLimitingCategory::Session => self.session,
|
||||||
RateLimitingCategory::Transaction => self.transaction,
|
RateLimitingCategory::Transaction => self.transaction,
|
||||||
RateLimitingCategory::Attachment => self.attachment,
|
RateLimitingCategory::Attachment => self.attachment,
|
||||||
RateLimitingCategory::Profile => self.profile,
|
|
||||||
}?;
|
}?;
|
||||||
time_left.duration_since(SystemTime::now()).ok()
|
time_left.duration_since(SystemTime::now()).ok()
|
||||||
}
|
}
|
||||||
@ -119,7 +116,6 @@ impl RateLimiter {
|
|||||||
}
|
}
|
||||||
EnvelopeItem::Transaction(_) => RateLimitingCategory::Transaction,
|
EnvelopeItem::Transaction(_) => RateLimitingCategory::Transaction,
|
||||||
EnvelopeItem::Attachment(_) => RateLimitingCategory::Attachment,
|
EnvelopeItem::Attachment(_) => RateLimitingCategory::Attachment,
|
||||||
EnvelopeItem::Profile(_) => RateLimitingCategory::Profile,
|
|
||||||
_ => RateLimitingCategory::Any,
|
_ => RateLimitingCategory::Any,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -139,8 +135,6 @@ pub enum RateLimitingCategory {
|
|||||||
Transaction,
|
Transaction,
|
||||||
/// Rate Limit pertaining to Attachments.
|
/// Rate Limit pertaining to Attachments.
|
||||||
Attachment,
|
Attachment,
|
||||||
/// Rate Limit pertaining to Profiles.
|
|
||||||
Profile,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Reference in New Issue
Block a user