From 4d011e7fe01c9ce990162cfcb6221c8984434ed3 Mon Sep 17 00:00:00 2001 From: Marie Date: Thu, 3 Oct 2024 20:02:55 +0200 Subject: [PATCH] chore: change typing, remove unusued imports --- packages/backend/src/core/SponsorsService.ts | 10 ++++++---- packages/backend/src/server/api/endpoints/sponsors.ts | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/core/SponsorsService.ts b/packages/backend/src/core/SponsorsService.ts index 6846df3554..df3e40fbd4 100644 --- a/packages/backend/src/core/SponsorsService.ts +++ b/packages/backend/src/core/SponsorsService.ts @@ -12,13 +12,15 @@ import { bindThis } from '@/decorators.js'; @Injectable() export class SponsorsService implements OnApplicationShutdown { - private cache: RedisKVCache; + private cache: RedisKVCache; constructor( - @Inject(DI.redis) private redisClient: Redis.Redis, + @Inject(DI.redis) + private redisClient: Redis.Redis, + private metaService: MetaService, ) { - this.cache = new RedisKVCache(this.redisClient, 'sponsors', { + this.cache = new RedisKVCache(this.redisClient, 'sponsors', { lifetime: 1000 * 60 * 60, memoryCacheLifetime: 1000 * 60, fetcher: (key) => { @@ -26,7 +28,7 @@ export class SponsorsService implements OnApplicationShutdown { return this.fetchSharkeySponsors(); }, toRedisConverter: (value) => JSON.stringify(value), - fromRedisConverter: (value) => JSON.parse(value) + fromRedisConverter: (value) => JSON.parse(value), }); } diff --git a/packages/backend/src/server/api/endpoints/sponsors.ts b/packages/backend/src/server/api/endpoints/sponsors.ts index fb6e51fd4e..2a8a461a8f 100644 --- a/packages/backend/src/server/api/endpoints/sponsors.ts +++ b/packages/backend/src/server/api/endpoints/sponsors.ts @@ -3,9 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { DI } from '@/di-symbols.js'; import { SponsorsService } from '@/core/SponsorsService.js'; export const meta = {