fix(server): debug port (#12745)

Fix debug port
This commit is contained in:
Min Idzelis 2024-09-16 23:13:38 -04:00 committed by GitHub
parent c468da589a
commit 7a755a089b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

8
.vscode/launch.json vendored
View File

@ -5,8 +5,8 @@
"type": "node",
"request": "attach",
"restart": true,
"port": 9230,
"name": "Immich Server",
"port": 9231,
"name": "Immich API Server",
"remoteRoot": "/usr/src/app",
"localRoot": "${workspaceFolder}/server"
},
@ -14,8 +14,8 @@
"type": "node",
"request": "attach",
"restart": true,
"port": 9231,
"name": "Immich Microservices",
"port": 9230,
"name": "Immich Workers",
"remoteRoot": "/usr/src/app",
"localRoot": "${workspaceFolder}/server"
}

View File

@ -43,6 +43,7 @@ services:
ports:
- 3001:3001
- 9230:9230
- 9231:9231
depends_on:
- redis
- database

View File

@ -18,7 +18,9 @@ async function bootstrapImmichAdmin() {
function bootstrapWorker(name: string) {
console.log(`Starting ${name} worker`);
const worker = name === 'api' ? fork(`./dist/workers/${name}.js`) : new Worker(`./dist/workers/${name}.js`);
const execArgv = process.execArgv.map((arg) => (arg.startsWith('--inspect') ? '--inspect=0.0.0.0:9231' : arg));
const worker =
name === 'api' ? fork(`./dist/workers/${name}.js`, [], { execArgv }) : new Worker(`./dist/workers/${name}.js`);
worker.on('error', (error) => {
console.error(`${name} worker error: ${error}`);