From 5d3c98ba829294a675ef23605cd8db8db790b499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20MEYER?= Date: Wed, 4 Dec 2024 11:01:20 +0100 Subject: [PATCH] feat(xo-web): merge backups synchronously --- .../_runners/_writers/_MixinRemoteWriter.mjs | 4 ++-- CHANGELOG.unreleased.md | 4 ++++ packages/xo-web/src/common/intl/messages.js | 1 + packages/xo-web/src/xo-app/backup/new/index.js | 18 ++++++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/@xen-orchestra/backups/_runners/_writers/_MixinRemoteWriter.mjs b/@xen-orchestra/backups/_runners/_writers/_MixinRemoteWriter.mjs index 20011b7dbef..c5c255be229 100644 --- a/@xen-orchestra/backups/_runners/_writers/_MixinRemoteWriter.mjs +++ b/@xen-orchestra/backups/_runners/_writers/_MixinRemoteWriter.mjs @@ -58,8 +58,8 @@ export const MixinRemoteWriter = (BaseClass = Object) => const { disableMergeWorker } = this._config // merge worker only compatible with local remotes const { handler } = this._adapter - const willMergeInWorker = !disableMergeWorker && typeof handler.getRealPath === 'function' - + const synchronousMerge = this._settings.mergeBackupSynchronouslyTpl === 'compactMjml' + const willMergeInWorker = !synchronousMerge && !disableMergeWorker && typeof handler.getRealPath === 'function' const { merge } = await this._cleanVm({ remove: true, merge: !willMergeInWorker }) await this.#lock.dispose() diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 57b89e197ff..6fcf6af9c3f 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -11,6 +11,8 @@ > Users must be able to say: “Nice enhancement, I'm eager to test it” +- [Backups/Advanced settings] Add merge backups synchronously (PR [#8177](https://github.com/vatesfr/xen-orchestra/pull/8177)) + ### Bug fixes > Users must be able to say: “I had this issue, happy to know it's fixed” @@ -31,7 +33,9 @@ +- @xen-orchestra/backups minor - @xen-orchestra/web patch - @xen-orchestra/web-core minor +- xo-web minor diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js index aa3d7d8a049..921bae9185f 100644 --- a/packages/xo-web/src/common/intl/messages.js +++ b/packages/xo-web/src/common/intl/messages.js @@ -570,6 +570,7 @@ const messages = { reportRecipients: 'Report recipients', reportWhen: 'Report when', concurrency: 'Concurrency', + mergeBackupsSynchronously: 'Merge backups synchronously', newBackupSelection: 'Select your backup type:', snapshotRetention: 'Snapshot retention', backupName: 'Name', diff --git a/packages/xo-web/src/xo-app/backup/new/index.js b/packages/xo-web/src/xo-app/backup/new/index.js index 7d62c930932..ee8c534b502 100644 --- a/packages/xo-web/src/xo-app/backup/new/index.js +++ b/packages/xo-web/src/xo-app/backup/new/index.js @@ -699,6 +699,11 @@ const New = decorate([ backupReportTpl: compactBackupTpl ? 'compactMjml' : 'mjml', }) }, + setMergeBackupsSynchronouslyTpl({ setGlobalSettings }, compactMergeTpl) { + setGlobalSettings({ + mergeBackupSynchronouslyTpl: compactMergeTpl ? 'compactMjml' : 'mjml', + }) + }, }, computed: { compressionId: generateId, @@ -711,6 +716,7 @@ const New = decorate([ inputNbdConcurrency: generateId, inputNRetriesVmBackupFailures: generateId, inputBackupReportTplId: generateId, + inputMergeBackupsSynchronously: generateId, inputTimeoutId: generateId, inputLongTermRetentionDaily: generateId, inputLongTermRetentionWeekly: generateId, @@ -836,6 +842,7 @@ const New = decorate([ reportRecipients, reportWhen = 'failure', backupReportTpl = 'mjml', + mergeBackupSynchronouslyTpl = 'mjml', timeout, } = settings.get('') || {} @@ -1230,6 +1237,17 @@ const New = decorate([ onChange={effects.setBackupReportTpl} /> + + + + )}