Connect lazily.

This commit is contained in:
LukeMathWalker 2021-09-29 09:15:19 +01:00
parent 2369d0f326
commit 2cec4ee7d1

View file

@ -13,9 +13,7 @@ async fn main() -> std::io::Result<()> {
let configuration = get_configuration().expect("Failed to read configuration.");
let connection_pool = PgPoolOptions::new()
.connect_timeout(std::time::Duration::from_secs(2))
.connect_with(configuration.database.with_db())
.await
.expect("Failed to connect to Postgres.");
.connect_lazy_with(configuration.database.with_db());
let sender_email = configuration
.email_client