mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Optimize
This commit is contained in:
@@ -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