From 7a755a089bf029bfc656e6b5023cf97dd520aac6 Mon Sep 17 00:00:00 2001 From: Min Idzelis Date: Mon, 16 Sep 2024 23:13:38 -0400 Subject: [PATCH] fix(server): debug port (#12745) Fix debug port --- .vscode/launch.json | 8 ++++---- docker/docker-compose.dev.yml | 1 + server/src/main.ts | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 7a88b7f3e1..ed3da9f667 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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" } diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index f42bcc0ab0..60685d84d6 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -43,6 +43,7 @@ services: ports: - 3001:3001 - 9230:9230 + - 9231:9231 depends_on: - redis - database diff --git a/server/src/main.ts b/server/src/main.ts index ee4de1a259..e32c3e43ac 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -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}`);