M-AI-07-05 added AiJobModule import to AiRuntimeModule, but AiJobModule already imports AiRuntimeModule (for SnapshotBuilderService). Use forwardRef(() => AiJobModule) to break the cycle. Root cause of deploy crash-loop: NestJS UndefinedModuleException at AiJobModule imports index [1] (AiRuntimeModule was undefined). Co-Authored-By: Claude <noreply@anthropic.com>
25 lines
1.6 KiB
TypeScript
25 lines
1.6 KiB
TypeScript
import { Module, forwardRef } from '@nestjs/common';
|
|
import { ConfigModule } from '@nestjs/config';
|
|
import { PrismaModule } from '../../infrastructure/database/prisma.module';
|
|
import { AiJobModule } from '../ai-job/ai-job.module';
|
|
import { UserAiController } from './user-ai.controller';
|
|
import { UserAiService } from './user-ai.service';
|
|
import { CredentialEncryptionService } from './credential-encryption.service';
|
|
import { RuntimeInternalController } from './internal/runtime-internal.controller';
|
|
import { RuntimeInternalService } from './internal/runtime-internal.service';
|
|
import { UserAiQuotaService } from './user-ai-quota.service';
|
|
import { PlatformBudgetService } from './platform-budget.service';
|
|
import { SnapshotBuilderService } from './snapshot-builder.service';
|
|
import { PriorityRulesService } from './priority-rules.service';
|
|
import { SnapshotCleanupService } from './snapshot-cleanup.service';
|
|
import { JobReaperService } from './job-reaper.service';
|
|
import { QuizExecutionRouter } from './quiz-execution-router';
|
|
|
|
@Module({
|
|
imports: [ConfigModule, PrismaModule, forwardRef(() => AiJobModule)],
|
|
controllers: [UserAiController, RuntimeInternalController],
|
|
providers: [UserAiService, CredentialEncryptionService, RuntimeInternalService, UserAiQuotaService, PlatformBudgetService, SnapshotBuilderService, PriorityRulesService, SnapshotCleanupService, JobReaperService, QuizExecutionRouter],
|
|
exports: [UserAiService, CredentialEncryptionService, RuntimeInternalService, UserAiQuotaService, PlatformBudgetService, SnapshotBuilderService, PriorityRulesService, SnapshotCleanupService, JobReaperService],
|
|
})
|
|
export class AiRuntimeModule {}
|