From 9152f6e1d8692c3d098c6253338bdbfe981c645e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20MEYER?= Date: Mon, 16 Dec 2024 10:57:43 +0100 Subject: [PATCH] fix(backups): backup worker inspect on another port --- @xen-orchestra/backups/runBackupWorker.mjs | 6 +++++- CHANGELOG.unreleased.md | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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 ad31aaf35a3..4db45d23622 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -33,4 +33,11 @@ +- @xen-orchestra/backups patch +- @xen-orchestra/web patch +- @xen-orchestra/web-core minor +- @xen-orchestra/xapi patch +- xen-api minor +- xo-server minor +