mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
test: server-info e2e tests (#3948)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { DomainModule } from '@app/domain';
|
||||
import { InfraModule } from '@app/infra';
|
||||
import { AssetEntity, ExifEntity } from '@app/infra/entities';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { Module, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { ScheduleModule } from '@nestjs/schedule';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
@@ -66,4 +66,14 @@ import {
|
||||
FileUploadInterceptor,
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
export class AppModule implements OnModuleInit, OnModuleDestroy {
|
||||
constructor(private appService: AppService) {}
|
||||
|
||||
async onModuleInit() {
|
||||
await this.appService.init();
|
||||
}
|
||||
|
||||
onModuleDestroy() {
|
||||
this.appService.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,8 @@ export class AppService {
|
||||
await this.searchService.init();
|
||||
this.logger.log(`Feature Flags: ${JSON.stringify(await this.serverService.getFeatures(), null, 2)}`);
|
||||
}
|
||||
|
||||
async destroy() {
|
||||
this.searchService.teardown();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import { NestExpressApplication } from '@nestjs/platform-express';
|
||||
import { json } from 'body-parser';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import { AppModule } from './app.module';
|
||||
import { AppService } from './app.service';
|
||||
import { useSwagger } from './app.utils';
|
||||
|
||||
const logger = new Logger('ImmichServer');
|
||||
@@ -27,7 +26,6 @@ export async function bootstrap() {
|
||||
app.useWebSocketAdapter(new RedisIoAdapter(app));
|
||||
useSwagger(app, isDev);
|
||||
|
||||
await app.get(AppService).init();
|
||||
const server = await app.listen(port);
|
||||
server.requestTimeout = 30 * 60 * 1000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user