Skip to content

Commit 728c205

Browse files
Update redis/cache.py
Co-authored-by: Copilot <[email protected]>
1 parent 3590399 commit 728c205

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

redis/cache.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,20 @@ class EvictionPolicyType(Enum):
1717

1818
@dataclass(frozen=True)
1919
class CacheKey:
20+
"""
21+
Represents a unique key for a cache entry.
22+
23+
Attributes:
24+
command (str): The Redis command being cached.
25+
redis_keys (tuple): The Redis keys involved in the command.
26+
redis_args (tuple): Additional arguments for the Redis command.
27+
This field is included in the cache key to ensure uniqueness
28+
when commands have the same keys but different arguments.
29+
Changing this field will affect cache key uniqueness.
30+
"""
2031
command: str
2132
redis_keys: tuple
22-
redis_args: tuple = ()
33+
redis_args: tuple = () # Additional arguments for the Redis command; affects cache key uniqueness.
2334

2435

2536
class CacheEntry:

0 commit comments

Comments
 (0)