mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 18:25:11 +00:00
chore: change typing, remove unusued imports
This commit is contained in:
parent
c2cc718f03
commit
4d011e7fe0
2 changed files with 7 additions and 6 deletions
|
@ -12,13 +12,15 @@ import { bindThis } from '@/decorators.js';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SponsorsService implements OnApplicationShutdown {
|
export class SponsorsService implements OnApplicationShutdown {
|
||||||
private cache: RedisKVCache<any>;
|
private cache: RedisKVCache<void[]>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(DI.redis) private redisClient: Redis.Redis,
|
@Inject(DI.redis)
|
||||||
|
private redisClient: Redis.Redis,
|
||||||
|
|
||||||
private metaService: MetaService,
|
private metaService: MetaService,
|
||||||
) {
|
) {
|
||||||
this.cache = new RedisKVCache<any>(this.redisClient, 'sponsors', {
|
this.cache = new RedisKVCache<void[]>(this.redisClient, 'sponsors', {
|
||||||
lifetime: 1000 * 60 * 60,
|
lifetime: 1000 * 60 * 60,
|
||||||
memoryCacheLifetime: 1000 * 60,
|
memoryCacheLifetime: 1000 * 60,
|
||||||
fetcher: (key) => {
|
fetcher: (key) => {
|
||||||
|
@ -26,7 +28,7 @@ export class SponsorsService implements OnApplicationShutdown {
|
||||||
return this.fetchSharkeySponsors();
|
return this.fetchSharkeySponsors();
|
||||||
},
|
},
|
||||||
toRedisConverter: (value) => JSON.stringify(value),
|
toRedisConverter: (value) => JSON.stringify(value),
|
||||||
fromRedisConverter: (value) => JSON.parse(value)
|
fromRedisConverter: (value) => JSON.parse(value),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* 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 { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
|
||||||
import { SponsorsService } from '@/core/SponsorsService.js';
|
import { SponsorsService } from '@/core/SponsorsService.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
|
|
Loading…
Reference in a new issue