mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Add user langs cache
This commit is contained in:
@@ -24,6 +24,7 @@ use self::bot_manager_client::get_bots;
|
||||
#[derive(Clone)]
|
||||
pub struct AppState {
|
||||
pub user_activity_cache: Cache<UserId, bool>,
|
||||
pub user_langs_cache: Cache<UserId, Vec<String>>,
|
||||
}
|
||||
|
||||
pub struct BotsManager {
|
||||
@@ -41,7 +42,11 @@ impl BotsManager {
|
||||
user_activity_cache: Cache::builder()
|
||||
.time_to_live(Duration::from_secs(5 * 60))
|
||||
.max_capacity(4096)
|
||||
.build()
|
||||
.build(),
|
||||
user_langs_cache: Cache::builder()
|
||||
.time_to_live(Duration::from_secs(5 * 60))
|
||||
.max_capacity(4096)
|
||||
.build(),
|
||||
},
|
||||
next_port: 8000,
|
||||
bot_port_map: HashMap::new(),
|
||||
|
||||
Reference in New Issue
Block a user