env override config port

This commit is contained in:
mbecker20
2023-07-17 04:40:57 +00:00
parent 2df881d43f
commit 0747bc9bc1
+5 -1
View File
@@ -45,7 +45,11 @@ pub struct State {
impl State {
pub async fn load() -> anyhow::Result<Arc<State>> {
let env = Env::load()?;
let config = CoreConfig::load(&env.config_path);
let mut config = CoreConfig::load(&env.config_path);
if let Some(port) = env.port {
config.port = port;
}
logger::init(config.log_level.into())?;