🐛 fix(manager.py): handle None key in __contains__ method to prevent Redis client error when checking if key exists in cache
This commit is contained in:
parent
fa1ebea378
commit
507d6a756d
1 changed files with 1 additions and 1 deletions
|
|
@ -292,7 +292,7 @@ class RedisCache(BaseCacheService, Service):
|
||||||
|
|
||||||
def __contains__(self, key):
|
def __contains__(self, key):
|
||||||
"""Check if the key is in the cache."""
|
"""Check if the key is in the cache."""
|
||||||
return self._client.exists(key)
|
return False if key is None else self._client.exists(key)
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
"""Retrieve an item from the cache using the square bracket notation."""
|
"""Retrieve an item from the cache using the square bracket notation."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue