1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-28 06:31:58 +00:00

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

View file

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

View file

@ -18,7 +18,9 @@ async function bootstrapImmichAdmin() {
function bootstrapWorker(name: string) { function bootstrapWorker(name: string) {
console.log(`Starting ${name} worker`); 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) => { worker.on('error', (error) => {
console.error(`${name} worker error: ${error}`); console.error(`${name} worker error: ${error}`);