mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 21:00:41 +00:00
feat: optimize attachment handling in backup process
This commit is contained in:
@@ -218,6 +218,7 @@ async function executeConfiguredBackup(
|
|||||||
: 'txt_backup_remote_run_progress_sync_attachments_skipped_detail',
|
: 'txt_backup_remote_run_progress_sync_attachments_skipped_detail',
|
||||||
});
|
});
|
||||||
const remoteSession = createRemoteBackupTransferSession(destination);
|
const remoteSession = createRemoteBackupTransferSession(destination);
|
||||||
|
if (destination.includeAttachments) {
|
||||||
const remoteAttachmentIndex = await loadRemoteAttachmentIndex(remoteSession);
|
const remoteAttachmentIndex = await loadRemoteAttachmentIndex(remoteSession);
|
||||||
let attachmentIndexChanged = false;
|
let attachmentIndexChanged = false;
|
||||||
for (const attachment of archive.manifest.attachmentBlobs || []) {
|
for (const attachment of archive.manifest.attachmentBlobs || []) {
|
||||||
@@ -239,6 +240,7 @@ async function executeConfiguredBackup(
|
|||||||
if (attachmentIndexChanged) {
|
if (attachmentIndexChanged) {
|
||||||
await saveRemoteAttachmentIndex(remoteSession, remoteAttachmentIndex);
|
await saveRemoteAttachmentIndex(remoteSession, remoteAttachmentIndex);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
let upload: Awaited<ReturnType<typeof uploadBackupArchive>> | null = null;
|
let upload: Awaited<ReturnType<typeof uploadBackupArchive>> | null = null;
|
||||||
for (let attempt = 1; attempt <= maxArchiveUploadAttempts; attempt++) {
|
for (let attempt = 1; attempt <= maxArchiveUploadAttempts; attempt++) {
|
||||||
await progress?.({
|
await progress?.({
|
||||||
|
|||||||
Reference in New Issue
Block a user