Starting impl Sentry and tracing
This commit is contained in:
+1
-4
@@ -1,5 +1,4 @@
|
||||
use anyhow::anyhow;
|
||||
use dotenvy::dotenv;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct EnvConfig {
|
||||
@@ -15,8 +14,6 @@ pub struct EnvConfig {
|
||||
}
|
||||
|
||||
pub fn load_config() -> anyhow::Result<EnvConfig> {
|
||||
dotenv().ok();
|
||||
|
||||
let http_port = try_get_env("HTTP_PORT")?.parse()?;
|
||||
let bot_name = try_get_env("BOT_NAME")?;
|
||||
let webhook_secret = try_get_env("WEBHOOK_SIG_HEADER_SECRET")?;
|
||||
@@ -40,7 +37,7 @@ pub fn load_config() -> anyhow::Result<EnvConfig> {
|
||||
})
|
||||
}
|
||||
|
||||
fn try_get_env(key: &str) -> anyhow::Result<String> {
|
||||
pub fn try_get_env(key: &str) -> anyhow::Result<String> {
|
||||
let env = std::env::var(key)?;
|
||||
|
||||
if env.trim().is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user