diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index b210c7c..b0b455d 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -10,6 +10,7 @@ import { TypeOrmModule } from '@nestjs/typeorm'; import { BullModule } from '@nestjs/bullmq'; import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler'; import { WinstonModule } from 'nest-winston'; +import { CacheModule } from '@nestjs/cache-manager'; // Redis store will be imported dynamically in the factory import { RedisModule } from '@nestjs-modules/ioredis'; @@ -93,6 +94,12 @@ import { MigrationModule } from './modules/migration/migration.module'; }), */ + // 🔄 Temporary Cache Module (In-Memory) for build fixes + CacheModule.register({ + isGlobal: true, // Make available globally for all modules + ttl: 300, // 5 minutes default TTL + }), + // 📝 Setup Winston Logger WinstonModule.forRoot(winstonConfig), diff --git a/backend/src/common/auth/auth.module.ts b/backend/src/common/auth/auth.module.ts index a3bf4ce..9bf974b 100644 --- a/backend/src/common/auth/auth.module.ts +++ b/backend/src/common/auth/auth.module.ts @@ -25,6 +25,7 @@ import type { StringValue } from 'ms'; TypeOrmModule.forFeature([User, RefreshToken]), // [P2-2] Added RefreshToken UserModule, PassportModule, + // CacheModule is now global (from AppModule) JwtModule.registerAsync({ imports: [ConfigModule], inject: [ConfigService], diff --git a/backend/src/modules/user/user.module.ts b/backend/src/modules/user/user.module.ts index fe0cd06..87402f0 100644 --- a/backend/src/modules/user/user.module.ts +++ b/backend/src/modules/user/user.module.ts @@ -3,7 +3,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { CacheModule } from '@nestjs/cache-manager'; import { UserService } from './user.service'; import { UserController } from './user.controller'; @@ -27,10 +26,7 @@ import { Permission } from './entities/permission.entity'; Role, Permission, ]), - // Add CacheModule for CACHE_MANAGER provider - CacheModule.register({ - isGlobal: false, // Keep it local to this module - }), + // CacheModule is now global (from AppModule) ], controllers: [UserController], providers: [