parent
75ea0bc38d
commit
10cd9c90e7
1 changed files with 8 additions and 15 deletions
|
|
@ -88,9 +88,7 @@ class RedisKVStorage(BaseKVStorage):
|
|||
cursor = 0
|
||||
|
||||
while True:
|
||||
cursor, keys = await redis.scan(
|
||||
cursor, match=pattern, count=100
|
||||
)
|
||||
cursor, keys = await redis.scan(cursor, match=pattern, count=100)
|
||||
|
||||
if keys:
|
||||
# Batch get values for these keys
|
||||
|
|
@ -104,14 +102,9 @@ class RedisKVStorage(BaseKVStorage):
|
|||
if value:
|
||||
try:
|
||||
data = json.loads(value)
|
||||
if (
|
||||
isinstance(data, dict)
|
||||
and data.get("cache_type") == "extract"
|
||||
):
|
||||
if isinstance(data, dict) and data.get("cache_type") == "extract":
|
||||
# Extract cache key (remove namespace prefix)
|
||||
cache_key = key.replace(
|
||||
f"{self.namespace}:", ""
|
||||
)
|
||||
cache_key = key.replace(f"{self.namespace}:", "")
|
||||
result[cache_key] = data
|
||||
except json.JSONDecodeError:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue