diff --git a/@xen-orchestra/backups/runBackupWorker.mjs b/@xen-orchestra/backups/runBackupWorker.mjs index 8f4cf1d3781..2693a5bc1a9 100644 --- a/@xen-orchestra/backups/runBackupWorker.mjs +++ b/@xen-orchestra/backups/runBackupWorker.mjs @@ -7,7 +7,11 @@ const PATH = new URL('_backupWorker.mjs', import.meta.url).pathname export function runBackupWorker(params, onLog) { return new Promise((resolve, reject) => { - const worker = fork(PATH) + const inspectArg = process.execArgv.find(arg => arg.startsWith('--inspect')) + const execArgv = inspectArg + ? [inspectArg.replace(/^(--inspect)(=.*)?$/, (_, prefix) => `${prefix}=localhost:9230`)] + : [] + const worker = fork(PATH, [], { execArgv }) worker.on('exit', (code, signal) => reject(new Error(`worker exited with code ${code} and signal ${signal}`))) worker.on('error', reject) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 1757ecbbc4e..ff8f6c13df9 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -38,6 +38,7 @@ +- @xen-orchestra/backups patch - @xen-orchestra/web patch - @xen-orchestra/web-core minor - @xen-orchestra/xapi patch