From 41a9b43fd9066221d2b2298a6661328f70ec95f2 Mon Sep 17 00:00:00 2001 From: Khor Shu Heng <32997938+khorshuheng@users.noreply.github.com> Date: Sun, 31 Mar 2024 10:38:15 +0800 Subject: [PATCH] fix: env variable load sequence (#429) --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 979f683b..0e79c51f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,13 +16,14 @@ async fn main() -> anyhow::Result<()> { filters.push(format!("database={}", level)); filters.push(format!("storage={}", level)); filters.push(format!("gotrue={}", level)); - let conf = - get_configuration().map_err(|e| anyhow::anyhow!("Failed to read configuration: {}", e))?; - init_subscriber(&conf.app_env, filters); // Load environment variables from .env file dotenvy::dotenv().ok(); + let conf = + get_configuration().map_err(|e| anyhow::anyhow!("Failed to read configuration: {}", e))?; + init_subscriber(&conf.app_env, filters); + let (tx, rx) = tokio::sync::mpsc::channel(1000); let state = init_state(&conf, tx) .await