Fix Backup info size display (#7540)

This commit is contained in:
Andrey Sobolev
2024-12-24 20:16:45 +07:00
committed by GitHub
parent b9cb463bfc
commit 30edf4ea8e
7 changed files with 38 additions and 12 deletions
+6 -1
View File
@@ -52,6 +52,7 @@ export class BackupClientOps {
return ctx.with('load-chunk', {}, async (ctx) => {
idx = idx ?? this.idIndex++
let chunk: ChunkInfo | undefined = this.chunkInfo.get(idx)
let size = 0
if (chunk !== undefined) {
chunk.index++
if (chunk.finished === undefined || chunk.finished) {
@@ -74,12 +75,16 @@ export class BackupClientOps {
break
}
docs.push(..._docs)
for (const d of _docs) {
size += d.size ?? 0
}
}
return {
idx,
docs,
finished: chunk.finished
finished: chunk.finished,
size
}
})
}