mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
Optimize
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -212,6 +212,7 @@ dependencies = [
|
||||
"sentry",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"smallvec",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"teloxide",
|
||||
|
||||
@@ -28,3 +28,4 @@ sentry = "0.31.3"
|
||||
lazy_static = "1.4.0"
|
||||
moka = { version = "0.11.1", features = ["future"] }
|
||||
axum = "0.6.18"
|
||||
smallvec = "1.10.0"
|
||||
|
||||
@@ -22,7 +22,7 @@ use super::{ignore_channel_messages, BotCommands, BotHandler, bots_manager::get_
|
||||
async fn _update_activity(
|
||||
me: teloxide::types::Me,
|
||||
user: teloxide::types::User,
|
||||
activity_cache: Cache<UserId, bool>,
|
||||
activity_cache: Cache<UserId, ()>,
|
||||
user_langs_cache: Cache<UserId, Vec<String>>,
|
||||
) -> Option<()> {
|
||||
if activity_cache.contains_key(&user.id) {
|
||||
@@ -50,7 +50,7 @@ async fn _update_activity(
|
||||
}
|
||||
|
||||
if update_result.is_ok() {
|
||||
activity_cache.insert(user.id, true).await;
|
||||
activity_cache.insert(user.id, ()).await;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ use crate::config;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct AppState {
|
||||
pub user_activity_cache: Cache<UserId, bool>,
|
||||
pub user_activity_cache: Cache<UserId, ()>,
|
||||
pub user_langs_cache: Cache<UserId, Vec<String>>,
|
||||
pub chat_donation_notifications_cache: Cache<ChatId, ()>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user