mirror of
https://github.com/HKUDS/LightRAG.git
synced 2025-12-04 10:58:53 +00:00
Revert "Fix linting"
This reverts commit abd9de2a63b39021320855fab9f5c3b332dee162.
This commit is contained in:
parent
75ea0bc38d
commit
10cd9c90e7
@ -88,9 +88,7 @@ class RedisKVStorage(BaseKVStorage):
|
|||||||
cursor = 0
|
cursor = 0
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
cursor, keys = await redis.scan(
|
cursor, keys = await redis.scan(cursor, match=pattern, count=100)
|
||||||
cursor, match=pattern, count=100
|
|
||||||
)
|
|
||||||
|
|
||||||
if keys:
|
if keys:
|
||||||
# Batch get values for these keys
|
# Batch get values for these keys
|
||||||
@ -104,14 +102,9 @@ class RedisKVStorage(BaseKVStorage):
|
|||||||
if value:
|
if value:
|
||||||
try:
|
try:
|
||||||
data = json.loads(value)
|
data = json.loads(value)
|
||||||
if (
|
if isinstance(data, dict) and data.get("cache_type") == "extract":
|
||||||
isinstance(data, dict)
|
|
||||||
and data.get("cache_type") == "extract"
|
|
||||||
):
|
|
||||||
# Extract cache key (remove namespace prefix)
|
# Extract cache key (remove namespace prefix)
|
||||||
cache_key = key.replace(
|
cache_key = key.replace(f"{self.namespace}:", "")
|
||||||
f"{self.namespace}:", ""
|
|
||||||
)
|
|
||||||
result[cache_key] = data
|
result[cache_key] = data
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user