From c9ddfe2b3051b2081138efe868cf827a72c7e033 Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Mon, 11 Sep 2023 02:03:52 -0400 Subject: [PATCH] enable shutdown hooks --- server/src/immich/main.ts | 4 ++-- server/src/microservices/main.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/immich/main.ts b/server/src/immich/main.ts index f262a173c..6e802ac44 100644 --- a/server/src/immich/main.ts +++ b/server/src/immich/main.ts @@ -14,8 +14,8 @@ const port = Number(process.env.SERVER_PORT) || 3001; const isDev = process.env.NODE_ENV === 'development'; export async function bootstrap() { - const app = await NestFactory.create(AppModule, { logger: getLogLevels() }); - + const app = await NestFactory.create(AppModule, { logger: getLogLevels(), forceCloseConnections: true }); + app.enableShutdownHooks(); app.set('trust proxy', ['loopback', 'linklocal', 'uniquelocal']); app.set('etag', 'strong'); app.use(cookieParser()); diff --git a/server/src/microservices/main.ts b/server/src/microservices/main.ts index 2937e6213..dc652d940 100644 --- a/server/src/microservices/main.ts +++ b/server/src/microservices/main.ts @@ -10,8 +10,8 @@ const port = Number(process.env.MICROSERVICES_PORT) || 3002; const envName = (process.env.NODE_ENV || 'development').toUpperCase(); export async function bootstrap() { - const app = await NestFactory.create(MicroservicesModule, { logger: getLogLevels() }); - + const app = await NestFactory.create(MicroservicesModule, { logger: getLogLevels(), forceCloseConnections: true }); + app.enableShutdownHooks(); app.useWebSocketAdapter(new RedisIoAdapter(app)); await app.get(AppService).init();