MCPcopy
hub / github.com/redis/redis-py / set

Method set

redis/cache.py:277–290  ·  redis/cache.py::CacheProxy.set
(self, entry: CacheEntry)

Source from the content-addressed store, hash-verified

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)

Calls 3

record_csc_evictionFunction · 0.90
is_exceeds_max_sizeMethod · 0.45
evict_nextMethod · 0.45