fix lint errors in UrlPreviewService
This commit is contained in:
parent
41536480ce
commit
c48faca707
|
@ -6,6 +6,7 @@
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { summaly } from '@misskey-dev/summaly';
|
import { summaly } from '@misskey-dev/summaly';
|
||||||
import { SummalyResult } from '@misskey-dev/summaly/built/summary.js';
|
import { SummalyResult } from '@misskey-dev/summaly/built/summary.js';
|
||||||
|
import * as Redis from 'ioredis';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { Config } from '@/config.js';
|
import type { Config } from '@/config.js';
|
||||||
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
||||||
|
@ -15,9 +16,8 @@ import { LoggerService } from '@/core/LoggerService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { ApiError } from '@/server/api/error.js';
|
import { ApiError } from '@/server/api/error.js';
|
||||||
import { MiMeta } from '@/models/Meta.js';
|
import { MiMeta } from '@/models/Meta.js';
|
||||||
import type { FastifyRequest, FastifyReply } from 'fastify';
|
|
||||||
import * as Redis from 'ioredis';
|
|
||||||
import { RedisKVCache } from '@/misc/cache.js';
|
import { RedisKVCache } from '@/misc/cache.js';
|
||||||
|
import type { FastifyRequest, FastifyReply } from 'fastify';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class UrlPreviewService {
|
export class UrlPreviewService {
|
||||||
|
@ -41,7 +41,7 @@ export class UrlPreviewService {
|
||||||
this.previewCache = new RedisKVCache<SummalyResult>(this.redisClient, 'summaly', {
|
this.previewCache = new RedisKVCache<SummalyResult>(this.redisClient, 'summaly', {
|
||||||
lifetime: 1000 * 60 * 60 * 24, // 1d
|
lifetime: 1000 * 60 * 60 * 24, // 1d
|
||||||
memoryCacheLifetime: 1000 * 60 * 10, // 10m
|
memoryCacheLifetime: 1000 * 60 * 10, // 10m
|
||||||
fetcher: (key: string) => { throw new Error('the UrlPreview cache should never fetch'); },
|
fetcher: () => { throw new Error('the UrlPreview cache should never fetch'); },
|
||||||
toRedisConverter: (value) => JSON.stringify(value),
|
toRedisConverter: (value) => JSON.stringify(value),
|
||||||
fromRedisConverter: (value) => JSON.parse(value),
|
fromRedisConverter: (value) => JSON.parse(value),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue