@xen-orchestra/backups 0.58.0 → 0.58.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/_cleanVm.mjs CHANGED
@@ -133,6 +133,7 @@ export async function checkAliases(
133
133
  await handler.unlink(alias)
134
134
  }
135
135
  }
136
+ continue
136
137
  }
137
138
 
138
139
  if (!isVhdFile(target)) {
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/vatesfr/xen-orchestra.git"
10
10
  },
11
- "version": "0.58.0",
11
+ "version": "0.58.1",
12
12
  "engines": {
13
13
  "node": ">=14.18"
14
14
  },
@@ -4,10 +4,22 @@ import { fork } from 'child_process'
4
4
  const { warn } = createLogger('xo:backups:backupWorker')
5
5
 
6
6
  const PATH = new URL('_backupWorker.mjs', import.meta.url).pathname
7
+ const DEFAULT_INSPECTOR_PORT = 9229
7
8
 
8
9
  export function runBackupWorker(params, onLog) {
9
10
  return new Promise((resolve, reject) => {
10
- const worker = fork(PATH)
11
+ // run Node inspector on port+1 if --inspect or --inspect-brk
12
+ const inspectArg = process.execArgv.find(arg => arg.startsWith('--inspect') || arg.startsWith('--inspect-brk'))
13
+ const execArgv = inspectArg
14
+ ? [
15
+ inspectArg.replace(/^(--inspect(-brk)?)(=([^:]+:)?(\d+))?$/, (_, prefix, brk, _fullMatch, host, port) => {
16
+ const basePort = port ? parseInt(port) : DEFAULT_INSPECTOR_PORT
17
+ return `${prefix}=${host || ''}${basePort + 1}`
18
+ }),
19
+ ]
20
+ : []
21
+
22
+ const worker = fork(PATH, [], { execArgv })
11
23
 
12
24
  worker.on('exit', (code, signal) => reject(new Error(`worker exited with code ${code} and signal ${signal}`)))
13
25
  worker.on('error', reject)