mirror of
https://github.com/chatmail/relay.git
synced 2026-09-13 19:03:14 +00:00
refactor: Remove unnecessary Arc (#36)
`Arc` around handler configs are not needed, as they are not shared. Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
committed by
GitHub
parent
47f16360a4
commit
8d18b73681
@@ -10,11 +10,10 @@ use async_trait::async_trait;
|
||||
use governor::{DefaultKeyedRateLimiter, Quota, RateLimiter};
|
||||
use lettre::{AsyncSmtpTransport, AsyncTransport, Tokio1Executor};
|
||||
use mailparse::{MailHeaderMap, parse_mail};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Handler for outgoing SMTP messages.
|
||||
pub struct OutgoingBeforeQueueHandler {
|
||||
config: Arc<Config>,
|
||||
config: Config,
|
||||
send_rate_limiter: DefaultKeyedRateLimiter<String>,
|
||||
}
|
||||
|
||||
@@ -23,7 +22,7 @@ impl OutgoingBeforeQueueHandler {
|
||||
let quota = Quota::per_minute(config.max_user_send_per_minute)
|
||||
.allow_burst(config.max_user_send_burst_size);
|
||||
Self {
|
||||
config: Arc::new(config),
|
||||
config,
|
||||
send_rate_limiter: RateLimiter::keyed(quota),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user