UBERF-6726: Fix clone for huge files (#5470)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-04-25 22:24:07 +07:00 committed by GitHub
parent 1d95c39d62
commit 16a891cd48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -229,6 +229,9 @@ export async function cloneWorkspace (
for (const c of domains) {
console.log('clone domain...', c)
// We need to clean target connection before copying something.
await cleanDomain(targetConnection, c)
const changes: Snapshot = {
added: new Map(),
updated: new Map(),
@ -291,9 +294,6 @@ export async function cloneWorkspace (
console.log('Retrieve chunk:', needRetrieve.length)
let docs: Doc[] = []
try {
// We need to clean target connection before copying something.
await cleanDomain(targetConnection, c)
docs = await sourceConnection.loadDocs(c, needRetrieve)
if (clearTime) {
docs = docs.map((p) => {