mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat: seperate sub-process for api worker (#10000)
This commit is contained in:
parent
7e2a03a8d9
commit
8f42766979
2 changed files with 7 additions and 8 deletions
|
|
@ -3,7 +3,6 @@ import { NestExpressApplication } from '@nestjs/platform-express';
|
|||
import { json } from 'body-parser';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import { existsSync } from 'node:fs';
|
||||
import { isMainThread } from 'node:worker_threads';
|
||||
import sirv from 'sirv';
|
||||
import { ApiModule } from 'src/app.module';
|
||||
import { envName, excludePaths, isDev, serverVersion, WEB_ROOT } from 'src/constants';
|
||||
|
|
@ -16,6 +15,7 @@ import { useSwagger } from 'src/utils/misc';
|
|||
const host = process.env.HOST;
|
||||
|
||||
async function bootstrap() {
|
||||
process.title = 'immich-api';
|
||||
otelSDK.start();
|
||||
|
||||
const port = Number(process.env.IMMICH_PORT) || 3001;
|
||||
|
|
@ -60,9 +60,7 @@ async function bootstrap() {
|
|||
logger.log(`Immich Server is listening on ${await app.getUrl()} [v${serverVersion}] [${envName}] `);
|
||||
}
|
||||
|
||||
if (!isMainThread) {
|
||||
bootstrap().catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
bootstrap().catch((error) => {
|
||||
console.error(error);
|
||||
throw error;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue