pass all the options to the cache constructor

This commit is contained in:
dakkar 2024-06-30 11:08:21 +01:00
parent 8cdea537e9
commit 320db585e3

View file

@ -40,6 +40,7 @@ export class UrlPreviewService {
this.previewCache = new RedisKVCache<SummalyResult>(this.redisClient, 'summaly', { this.previewCache = new RedisKVCache<SummalyResult>(this.redisClient, 'summaly', {
lifetime: 1000 * 86400, lifetime: 1000 * 86400,
memoryCacheLifetime: 1000 * 10 * 60, memoryCacheLifetime: 1000 * 10 * 60,
fetcher: (key: string) => { 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),
}); });