mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2025-01-20 22:08:06 +00:00
Connect lazily.
This commit is contained in:
parent
2369d0f326
commit
2cec4ee7d1
1 changed files with 1 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue