From 7698db88e519ccc9a96f16eeafa0a4b7200cc7d0 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sat, 7 Dec 2024 11:05:26 -0500 Subject: [PATCH] fix DI in SkRateLimiterService --- .../backend/src/server/api/SkRateLimiterService.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/SkRateLimiterService.ts b/packages/backend/src/server/api/SkRateLimiterService.ts index c44accdb09..5d865a3c07 100644 --- a/packages/backend/src/server/api/SkRateLimiterService.ts +++ b/packages/backend/src/server/api/SkRateLimiterService.ts @@ -3,12 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Injectable } from '@nestjs/common'; +import { Inject, Injectable } from '@nestjs/common'; import Redis from 'ioredis'; import type { IEndpointMeta } from '@/server/api/endpoints.js'; import { LoggerService } from '@/core/LoggerService.js'; import { TimeService } from '@/core/TimeService.js'; import { EnvService } from '@/core/EnvService.js'; +import { DI } from '@/di-symbols.js'; import { RateLimiterService } from './RateLimiterService.js'; /** @@ -111,9 +112,16 @@ export function hasMinLimit(limit: LegacyRateLimit): limit is LegacyRateLimit & @Injectable() export class SkRateLimiterService extends RateLimiterService { constructor( + @Inject(TimeService) private readonly timeService: TimeService, + + @Inject(DI.redis) redisClient: Redis.Redis, + + @Inject(LoggerService) loggerService: LoggerService, + + @Inject(EnvService) envService: EnvService, ) { super(redisClient, loggerService, envService);