Final fixes for docker optimisation

Also fixed up error of forgetting to include an await in the main function
This commit is contained in:
Nick Bland 2021-11-16 20:55:54 +10:00
parent e2c83c817b
commit 6741ed9e14
No known key found for this signature in database
GPG Key ID: B46CF88E4DAB4A2C
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
name = "mail_app" name = "mail_app"
version = "0.1.0" version = "0.1.0"
authors = ["Nick Bland"] authors = ["Nick Bland"]
edition = "2021" edition = "2018"
[lib] [lib]
path = "src/lib.rs" path = "src/lib.rs"

View File

@ -1,5 +1,4 @@
use std::net::TcpListener; use std::net::TcpListener;
use sqlx::PgPool;
use sqlx::postgres::PgPoolOptions; use sqlx::postgres::PgPoolOptions;
use mail_app::startup::run; use mail_app::startup::run;
@ -18,6 +17,7 @@ async fn main() -> std::io::Result<()> {
let connection_pool = PgPoolOptions::new() let connection_pool = PgPoolOptions::new()
.connect_timeout(std::time::Duration::from_secs(2)) .connect_timeout(std::time::Duration::from_secs(2))
.connect(&configuration.database.connection_string()) .connect(&configuration.database.connection_string())
.await
.expect("Failed to connect to Postgres."); .expect("Failed to connect to Postgres.");
// Take port from settings file // Take port from settings file