diff --git a/server/apps/immich/src/api-v1/job/job.module.ts b/server/apps/immich/src/api-v1/job/job.module.ts index 38c1326e27..cc513af409 100644 --- a/server/apps/immich/src/api-v1/job/job.module.ts +++ b/server/apps/immich/src/api-v1/job/job.module.ts @@ -1,14 +1,10 @@ import { Module } from '@nestjs/common'; import { JobService } from './job.service'; import { JobController } from './job.controller'; -import { TypeOrmModule } from '@nestjs/typeorm'; -import { ExifEntity } from '@app/infra'; -import { TagModule } from '../tag/tag.module'; import { AssetModule } from '../asset/asset.module'; -import { StorageModule } from '@app/storage'; @Module({ - imports: [TypeOrmModule.forFeature([ExifEntity]), TagModule, AssetModule, StorageModule], + imports: [AssetModule], controllers: [JobController], providers: [JobService], }) diff --git a/server/apps/immich/src/app.module.ts b/server/apps/immich/src/app.module.ts index 37f47dca78..8a7f73155c 100644 --- a/server/apps/immich/src/app.module.ts +++ b/server/apps/immich/src/app.module.ts @@ -1,5 +1,5 @@ import { immichAppConfig } from '@app/common/config'; -import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; +import { Module } from '@nestjs/common'; import { AssetModule } from './api-v1/asset/asset.module'; import { ConfigModule } from '@nestjs/config'; import { ServerInfoModule } from './api-v1/server-info/server-info.module'; @@ -61,12 +61,4 @@ import { AuthGuard } from './middlewares/auth.guard'; ], providers: [{ provide: APP_GUARD, useExisting: AuthGuard }, AuthGuard], }) -export class AppModule implements NestModule { - // TODO: check if consumer is needed or remove - // eslint-disable-next-line @typescript-eslint/no-unused-vars - configure(consumer: MiddlewareConsumer): void { - if (process.env.NODE_ENV == 'development') { - // consumer.apply(AppLoggerMiddleware).forRoutes('*'); - } - } -} +export class AppModule {} diff --git a/server/apps/immich/src/middlewares/app-logger.middleware.ts b/server/apps/immich/src/middlewares/app-logger.middleware.ts deleted file mode 100644 index 44accec190..0000000000 --- a/server/apps/immich/src/middlewares/app-logger.middleware.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Injectable, NestMiddleware, Logger } from '@nestjs/common'; - -import { Request, Response, NextFunction } from 'express'; - -@Injectable() -export class AppLoggerMiddleware implements NestMiddleware { - private logger = new Logger('HTTP'); - - use(request: Request, response: Response, next: NextFunction): void { - const { ip, method, baseUrl } = request; - const userAgent = request.get('user-agent') || ''; - - response.on('close', () => { - const { statusCode } = response; - const contentLength = response.get('content-length'); - - this.logger.log(`${method} ${baseUrl} ${statusCode} ${contentLength} - ${userAgent} ${ip}`); - }); - - next(); - } -}