mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
style: rustfmt config.rs and main.rs from the last two features
This commit is contained in:
@@ -46,19 +46,17 @@ impl Config {
|
|||||||
if !bad.is_empty() {
|
if !bad.is_empty() {
|
||||||
log::warn!("BOT_ADMIN: ignoring non-numeric ids: {bad:?}");
|
log::warn!("BOT_ADMIN: ignoring non-numeric ids: {bad:?}");
|
||||||
}
|
}
|
||||||
ids.into_iter().filter_map(|p| p.parse::<i64>().ok()).collect()
|
ids.into_iter()
|
||||||
|
.filter_map(|p| p.parse::<i64>().ok())
|
||||||
|
.collect()
|
||||||
}
|
}
|
||||||
Err(_) => Vec::new(),
|
Err(_) => Vec::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let edit_message_ttl = Duration::from_secs(parse_u64(
|
let edit_message_ttl =
|
||||||
"EDIT_MESSAGE_TTL_SECONDS",
|
Duration::from_secs(parse_u64("EDIT_MESSAGE_TTL_SECONDS", 24 * 3600));
|
||||||
24 * 3600,
|
let link_cache_ttl =
|
||||||
));
|
Duration::from_secs(parse_u64("LINK_CACHE_TTL_SECONDS", 7 * 24 * 3600));
|
||||||
let link_cache_ttl = Duration::from_secs(parse_u64(
|
|
||||||
"LINK_CACHE_TTL_SECONDS",
|
|
||||||
7 * 24 * 3600,
|
|
||||||
));
|
|
||||||
|
|
||||||
let webhook_enabled = env::var("WEBHOOK")
|
let webhook_enabled = env::var("WEBHOOK")
|
||||||
.is_ok_and(|v| matches!(v.to_lowercase().as_str(), "true" | "yes" | "1"));
|
.is_ok_and(|v| matches!(v.to_lowercase().as_str(), "true" | "yes" | "1"));
|
||||||
|
|||||||
@@ -191,7 +191,10 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
TASK_QUEUE.stop().await;
|
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");
|
log::warn!("graceful shutdown timed out after {SHUTDOWN_TIMEOUT:?}; exiting");
|
||||||
} else {
|
} else {
|
||||||
log::info!("Bot stopped");
|
log::info!("Bot stopped");
|
||||||
|
|||||||
Reference in New Issue
Block a user