This commit is contained in:
Mikhail Kilin
2026-01-31 03:48:50 +03:00
parent 1bf9b3d703
commit 644e36597d
37 changed files with 1070 additions and 600 deletions

View File

@@ -61,7 +61,7 @@ impl<V: Clone> LruCache<V> {
}
/// Проверить наличие ключа
pub fn contains_key(&self, key: &i64) -> bool {
pub fn contains_key(&self, key: &UserId) -> bool {
self.map.contains_key(key)
}
@@ -181,7 +181,7 @@ impl UserCache {
}
// Берём первые N user_ids для загрузки
let batch: Vec<i64> = self
let batch: Vec<UserId> = self
.pending_user_ids
.drain(..self.pending_user_ids.len().min(LAZY_LOAD_USERS_PER_TICK))
.collect();
@@ -191,7 +191,7 @@ impl UserCache {
continue; // Уже в кэше
}
match functions::get_user(user_id, self.client_id).await {
match functions::get_user(user_id.as_i64(), self.client_id).await {
Ok(user_enum) => {
self.handle_user_update(&user_enum);
}