pool: use better defaults

* increases the max_size to r2d2' default of 10
* decreases the min_idle number of connections to 0 (was equal to max_size before)
* decreases the idle timeout from 10 minutes to 1 minute
This commit is contained in:
Paolo Barbolini
2020-09-08 21:14:05 +02:00
committed by Alexis Mousset
parent 087e1e9c31
commit c59f67d808

View File

@@ -150,7 +150,10 @@ impl SmtpTransportBuilder {
let client = self.build_client();
SmtpTransport {
#[cfg(feature = "r2d2")]
inner: Pool::builder().max_size(5).build_unchecked(client),
inner: Pool::builder()
.min_idle(Some(0))
.idle_timeout(Some(Duration::from_secs(60)))
.build_unchecked(client),
#[cfg(not(feature = "r2d2"))]
inner: client,
}