Final fixes for docker optimisation
Also fixed up error of forgetting to include an await in the main function
This commit is contained in:
parent
e2c83c817b
commit
6741ed9e14
@ -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"
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user