diff --git a/crates/xmedia-bot/src/config.rs b/crates/xmedia-bot/src/config.rs index 4449392..c13c2e8 100644 --- a/crates/xmedia-bot/src/config.rs +++ b/crates/xmedia-bot/src/config.rs @@ -46,19 +46,17 @@ impl Config { if !bad.is_empty() { log::warn!("BOT_ADMIN: ignoring non-numeric ids: {bad:?}"); } - ids.into_iter().filter_map(|p| p.parse::().ok()).collect() + ids.into_iter() + .filter_map(|p| p.parse::().ok()) + .collect() } Err(_) => Vec::new(), }; - let edit_message_ttl = Duration::from_secs(parse_u64( - "EDIT_MESSAGE_TTL_SECONDS", - 24 * 3600, - )); - let link_cache_ttl = Duration::from_secs(parse_u64( - "LINK_CACHE_TTL_SECONDS", - 7 * 24 * 3600, - )); + let edit_message_ttl = + Duration::from_secs(parse_u64("EDIT_MESSAGE_TTL_SECONDS", 24 * 3600)); + let link_cache_ttl = + Duration::from_secs(parse_u64("LINK_CACHE_TTL_SECONDS", 7 * 24 * 3600)); let webhook_enabled = env::var("WEBHOOK") .is_ok_and(|v| matches!(v.to_lowercase().as_str(), "true" | "yes" | "1")); diff --git a/crates/xmedia-bot/src/main.rs b/crates/xmedia-bot/src/main.rs index cf2596a..f4be25f 100644 --- a/crates/xmedia-bot/src/main.rs +++ b/crates/xmedia-bot/src/main.rs @@ -191,7 +191,10 @@ async fn main() { } TASK_QUEUE.stop().await; }; - if tokio::time::timeout(SHUTDOWN_TIMEOUT, shutdown).await.is_err() { + if tokio::time::timeout(SHUTDOWN_TIMEOUT, shutdown) + .await + .is_err() + { log::warn!("graceful shutdown timed out after {SHUTDOWN_TIMEOUT:?}; exiting"); } else { log::info!("Bot stopped");