Evict the oldest (FIFO) entry from this shard. Returns `true` if an entry was removed.
(&mut self)
| 66 | /// Evict the oldest (FIFO) entry from this shard. Returns `true` if an |
| 67 | /// entry was removed. |
| 68 | fn evict_one(&mut self) -> bool { |
| 69 | while let Some(evicted) = self.order.pop_front() { |
| 70 | if self.entries.remove(&evicted).is_some() { |
| 71 | if let Some(count) = self.tenant_counts.get_mut(&evicted.tenant_id) { |
| 72 | *count = count.saturating_sub(1); |
| 73 | } |
| 74 | return true; |
| 75 | } |
| 76 | // Key was already removed (e.g., by `invalidate`); skip stale entry. |
| 77 | } |
| 78 | false |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | /// Bounded, database-sharded, weighted-LRU document cache. |
no test coverage detected