fix(gateway): add missing @Inject() decorators causing silent startup hang (#109)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful

Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #109.
This commit is contained in:
2026-03-15 01:52:01 +00:00
committed by jason.woltje
parent 9d01a0d484
commit 6d2b81f6e4
5 changed files with 14 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ export class ProviderService implements OnModuleInit {
private readonly logger = new Logger(ProviderService.name);
private registry!: ModelRegistry;
async onModuleInit(): Promise<void> {
onModuleInit(): void {
const authStorage = AuthStorage.inMemory();
this.registry = new ModelRegistry(authStorage);

View File

@@ -1,4 +1,10 @@
import { Injectable, Logger, type OnModuleInit, type OnModuleDestroy } from '@nestjs/common';
import {
Inject,
Injectable,
Logger,
type OnModuleInit,
type OnModuleDestroy,
} from '@nestjs/common';
import cron from 'node-cron';
import { SummarizationService } from './summarization.service.js';
@@ -7,7 +13,7 @@ export class CronService implements OnModuleInit, OnModuleDestroy {
private readonly logger = new Logger(CronService.name);
private readonly tasks: cron.ScheduledTask[] = [];
constructor(private readonly summarization: SummarizationService) {}
constructor(@Inject(SummarizationService) private readonly summarization: SummarizationService) {}
onModuleInit(): void {
const summarizationSchedule = process.env['SUMMARIZATION_CRON'] ?? '0 */6 * * *'; // every 6 hours

View File

@@ -29,7 +29,7 @@ export class SummarizationService {
constructor(
@Inject(LOG_SERVICE) private readonly logService: LogService,
@Inject(MEMORY) private readonly memory: Memory,
private readonly embeddings: EmbeddingService,
@Inject(EmbeddingService) private readonly embeddings: EmbeddingService,
@Inject(DB) private readonly db: Db,
) {
this.apiKey = process.env['OPENAI_API_KEY'];

View File

@@ -15,6 +15,8 @@ import { AppModule } from './app.module.js';
import { mountAuthHandler } from './auth/auth.controller.js';
async function bootstrap(): Promise<void> {
const logger = new Logger('Bootstrap');
if (!process.env['BETTER_AUTH_SECRET']) {
throw new Error('BETTER_AUTH_SECRET is required');
}
@@ -28,7 +30,6 @@ async function bootstrap(): Promise<void> {
);
}
const logger = new Logger('Bootstrap');
const app = await NestFactory.create<NestFastifyApplication>(
AppModule,
new FastifyAdapter({ bodyLimit: 1_048_576 }),

View File

@@ -5,6 +5,7 @@ import {
Get,
HttpCode,
HttpStatus,
Inject,
NotFoundException,
Param,
Patch,
@@ -18,7 +19,7 @@ import type { CreateSkillDto, UpdateSkillDto } from './skills.dto.js';
@Controller('api/skills')
@UseGuards(AuthGuard)
export class SkillsController {
constructor(private readonly skills: SkillsService) {}
constructor(@Inject(SkillsService) private readonly skills: SkillsService) {}
@Get()
async list() {