From a0e64ad96ccbaf26f2132579fc866b6e2f089c17 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 10 Dec 2022 15:50:46 +0000 Subject: [PATCH] Allow setting db port --- web-api/Cargo.toml | 2 +- web-api/src/config.rs | 1 + web-api/src/database/mod.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web-api/Cargo.toml b/web-api/Cargo.toml index 0c49e13..895126d 100644 --- a/web-api/Cargo.toml +++ b/web-api/Cargo.toml @@ -19,6 +19,6 @@ tower = "0.4" tracing = "0.1" tracing-subscriber = "0.3" toml = "0.5" -tokio = { version = "1.18", features = ["macros"] } +tokio = { version = "1.18", features = ["full"] } tokio-postgres = { version = "0.7", features = ["with-chrono-0_4", "with-serde_json-1"] } uuid = { version = "1.0", features = ["v4"] } diff --git a/web-api/src/config.rs b/web-api/src/config.rs index 7106d75..03cec06 100644 --- a/web-api/src/config.rs +++ b/web-api/src/config.rs @@ -20,5 +20,6 @@ pub struct DatabaseConfig { pub user: String, pub password: String, pub host: String, + pub port: u16, pub database: String, } diff --git a/web-api/src/database/mod.rs b/web-api/src/database/mod.rs index fd001eb..91c4899 100644 --- a/web-api/src/database/mod.rs +++ b/web-api/src/database/mod.rs @@ -28,6 +28,7 @@ impl From for Config { c.user = Some(config.user); c.password = Some(config.password); c.host = Some(config.host); + c.port = Some(config.port); c.dbname = Some(config.database); c.manager = Some(ManagerConfig { recycling_method: RecyclingMethod::Verified, -- libgit2 1.7.2