cherry-pick a75efb06
This commit is contained in:
parent
29be1f07a0
commit
e895184b5f
1 changed files with 4 additions and 4 deletions
|
|
@ -224,7 +224,7 @@ class MigrationTool:
|
||||||
if key.startswith("default:extract:") or key.startswith(
|
if key.startswith("default:extract:") or key.startswith(
|
||||||
"default:summary:"
|
"default:summary:"
|
||||||
):
|
):
|
||||||
filtered[key] = value
|
filtered[key] = value.copy()
|
||||||
return filtered
|
return filtered
|
||||||
|
|
||||||
async def get_default_caches_redis(
|
async def get_default_caches_redis(
|
||||||
|
|
@ -399,7 +399,7 @@ class MigrationTool:
|
||||||
for field_name in ["namespace", "workspace", "_id", "content"]:
|
for field_name in ["namespace", "workspace", "_id", "content"]:
|
||||||
doc_copy.pop(field_name, None)
|
doc_copy.pop(field_name, None)
|
||||||
|
|
||||||
cache_data[key] = doc_copy
|
cache_data[key] = doc_copy.copy()
|
||||||
|
|
||||||
# Periodically yield control (every batch_size documents)
|
# Periodically yield control (every batch_size documents)
|
||||||
if len(cache_data) % batch_size == 0:
|
if len(cache_data) % batch_size == 0:
|
||||||
|
|
@ -584,7 +584,7 @@ class MigrationTool:
|
||||||
# Now iterate over snapshot without holding lock
|
# Now iterate over snapshot without holding lock
|
||||||
batch = {}
|
batch = {}
|
||||||
for key, value in matching_items:
|
for key, value in matching_items:
|
||||||
batch[key] = value
|
batch[key] = value.copy()
|
||||||
if len(batch) >= batch_size:
|
if len(batch) >= batch_size:
|
||||||
yield batch
|
yield batch
|
||||||
batch = {}
|
batch = {}
|
||||||
|
|
@ -745,7 +745,7 @@ class MigrationTool:
|
||||||
for field_name in ["namespace", "workspace", "_id", "content"]:
|
for field_name in ["namespace", "workspace", "_id", "content"]:
|
||||||
doc_copy.pop(field_name, None)
|
doc_copy.pop(field_name, None)
|
||||||
|
|
||||||
batch[key] = doc_copy
|
batch[key] = doc_copy.copy()
|
||||||
|
|
||||||
if len(batch) >= batch_size:
|
if len(batch) >= batch_size:
|
||||||
yield batch
|
yield batch
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue