| 275 | return self._cache.get(key) |
| 276 | |
| 277 | def set(self, entry: CacheEntry) -> bool: |
| 278 | is_set = self._cache.set(entry) |
| 279 | |
| 280 | if self.config.is_exceeds_max_size(self.size): |
| 281 | class="cm"># Lazy import to avoid circular dependency |
| 282 | from redis.observability.recorder import record_csc_eviction |
| 283 | |
| 284 | record_csc_eviction( |
| 285 | count=1, |
| 286 | reason=CSCReason.FULL, |
| 287 | ) |
| 288 | self.eviction_policy.evict_next() |
| 289 | |
| 290 | return is_set |
| 291 | |
| 292 | def delete_by_cache_keys(self, cache_keys: List[CacheKey]) -> List[bool]: |
| 293 | return self._cache.delete_by_cache_keys(cache_keys) |