From e895184b5f3d5cb908ad7047d6060e17e26ac5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20MANSUY?= Date: Thu, 4 Dec 2025 19:19:02 +0800 Subject: [PATCH] cherry-pick a75efb06 --- lightrag/tools/migrate_llm_cache.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightrag/tools/migrate_llm_cache.py b/lightrag/tools/migrate_llm_cache.py index db6933b2..44293cee 100644 --- a/lightrag/tools/migrate_llm_cache.py +++ b/lightrag/tools/migrate_llm_cache.py @@ -224,7 +224,7 @@ class MigrationTool: if key.startswith("default:extract:") or key.startswith( "default:summary:" ): - filtered[key] = value + filtered[key] = value.copy() return filtered async def get_default_caches_redis( @@ -399,7 +399,7 @@ class MigrationTool: for field_name in ["namespace", "workspace", "_id", "content"]: doc_copy.pop(field_name, None) - cache_data[key] = doc_copy + cache_data[key] = doc_copy.copy() # Periodically yield control (every batch_size documents) if len(cache_data) % batch_size == 0: @@ -584,7 +584,7 @@ class MigrationTool: # Now iterate over snapshot without holding lock batch = {} for key, value in matching_items: - batch[key] = value + batch[key] = value.copy() if len(batch) >= batch_size: yield batch batch = {} @@ -745,7 +745,7 @@ class MigrationTool: for field_name in ["namespace", "workspace", "_id", "content"]: doc_copy.pop(field_name, None) - batch[key] = doc_copy + batch[key] = doc_copy.copy() if len(batch) >= batch_size: yield batch