Skip to content

Commit

Permalink
fix(backups): backup worker inspect on another port
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-m-dev committed Dec 16, 2024
1 parent 56a18eb commit 9152f6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion @xen-orchestra/backups/runBackupWorker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,11 @@
<!--packages-start-->

- @xen-orchestra/backups patch
- @xen-orchestra/web patch
- @xen-orchestra/web-core minor
- @xen-orchestra/xapi patch
- xen-api minor
- xo-server minor

<!--packages-end-->

0 comments on commit 9152f6e

Please sign in to comment.