fix: env variable load sequence (#429)

This commit is contained in:
Khor Shu Heng 2024-03-31 10:38:15 +08:00 committed by GitHub
parent a6b1c93a84
commit 41a9b43fd9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -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