enable shutdown hooks
This commit is contained in:
parent
5d1011b482
commit
c9ddfe2b30
2 changed files with 4 additions and 4 deletions
|
@ -14,8 +14,8 @@ const port = Number(process.env.SERVER_PORT) || 3001;
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
export async function bootstrap() {
|
export async function bootstrap() {
|
||||||
const app = await NestFactory.create<NestExpressApplication>(AppModule, { logger: getLogLevels() });
|
const app = await NestFactory.create<NestExpressApplication>(AppModule, { logger: getLogLevels(), forceCloseConnections: true });
|
||||||
|
app.enableShutdownHooks();
|
||||||
app.set('trust proxy', ['loopback', 'linklocal', 'uniquelocal']);
|
app.set('trust proxy', ['loopback', 'linklocal', 'uniquelocal']);
|
||||||
app.set('etag', 'strong');
|
app.set('etag', 'strong');
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
|
|
|
@ -10,8 +10,8 @@ const port = Number(process.env.MICROSERVICES_PORT) || 3002;
|
||||||
const envName = (process.env.NODE_ENV || 'development').toUpperCase();
|
const envName = (process.env.NODE_ENV || 'development').toUpperCase();
|
||||||
|
|
||||||
export async function bootstrap() {
|
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));
|
app.useWebSocketAdapter(new RedisIoAdapter(app));
|
||||||
|
|
||||||
await app.get(AppService).init();
|
await app.get(AppService).init();
|
||||||
|
|
Loading…
Reference in a new issue