improve code for global

This commit is contained in:
houseme
2025-04-21 21:39:57 +08:00
parent 5af648230a
commit 6c70c03985
4 changed files with 46 additions and 21 deletions
+1 -4
View File
@@ -11,10 +11,9 @@ use tokio::signal;
async fn main() -> Result<(), Box<dyn error::Error>> {
tracing_subscriber::fmt::init();
let mut config = NotificationConfig {
let config = NotificationConfig {
store_path: "./events".to_string(),
channel_capacity: 100,
timeout: 50,
adapters: vec![AdapterConfig::Webhook(WebhookConfig {
endpoint: "http://localhost:8080/webhook".to_string(),
auth_token: Some("secret-token".to_string()),
@@ -22,9 +21,7 @@ async fn main() -> Result<(), Box<dyn error::Error>> {
max_retries: 3,
timeout: 10,
})],
http: Default::default(),
};
config.http.port = 8080;
// loading configuration from specific env files
let _config = NotificationConfig::from_env_file(".env.example")?;