From 2cec4ee7d164b106133ccc33c468021269d4903f Mon Sep 17 00:00:00 2001 From: LukeMathWalker Date: Wed, 29 Sep 2021 09:15:19 +0100 Subject: [PATCH] Connect lazily. --- src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 37c7415..253f477 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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