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 04dd9e9 commit 8c9ffd7
Show file tree
Hide file tree
Showing 2 changed files with 6 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
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<!--packages-start-->

- @xen-orchestra/backups patch
- @xen-orchestra/web patch
- @xen-orchestra/web-core minor
- @xen-orchestra/xapi patch
Expand Down

0 comments on commit 8c9ffd7

Please sign in to comment.