mirror of
https://github.com/chatmail/relay.git
synced 2026-09-15 11:53:14 +00:00
feat: Configurable rate limiter max burst size (#28)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
committed by
GitHub
parent
9a8e4fe65c
commit
23231d462c
@@ -20,7 +20,8 @@ pub struct OutgoingBeforeQueueHandler {
|
||||
|
||||
impl OutgoingBeforeQueueHandler {
|
||||
pub fn new(config: Config) -> Self {
|
||||
let quota = Quota::per_minute(config.max_user_send_per_minute);
|
||||
let quota = Quota::per_minute(config.max_user_send_per_minute)
|
||||
.allow_burst(config.max_user_send_burst_size);
|
||||
Self {
|
||||
config: Arc::new(config),
|
||||
send_rate_limiter: RateLimiter::keyed(quota),
|
||||
|
||||
Reference in New Issue
Block a user