cache bug
This commit is contained in:
@@ -11,12 +11,12 @@ export function cacheConfig(): CacheModuleAsyncOptions {
|
|||||||
useFactory: async (configService: ConfigService) => {
|
useFactory: async (configService: ConfigService) => {
|
||||||
const redisUri = configService.get('REDIS_URI');
|
const redisUri = configService.get('REDIS_URI');
|
||||||
const namespace = configService.get('CACHE_NAMESPACE', 'app-cache');
|
const namespace = configService.get('CACHE_NAMESPACE', 'app-cache');
|
||||||
const ttl = configService.get<number>('CACHE_TTL', 3600);
|
const ttl = +configService.get<number>('CACHE_TTL', 3600); //1 hour
|
||||||
|
|
||||||
return {
|
return {
|
||||||
stores: [
|
stores: [
|
||||||
new Keyv({
|
new Keyv({
|
||||||
store: new CacheableMemory({ ttl: ttl*1000, lruSize: 5000 }),
|
store: new CacheableMemory({ ttl: ttl * 1000, lruSize: 5000 }),
|
||||||
namespace: namespace
|
namespace: namespace
|
||||||
}),
|
}),
|
||||||
new KeyvRedis(redisUri, { namespace: namespace }),
|
new KeyvRedis(redisUri, { namespace: namespace }),
|
||||||
|
|||||||
Reference in New Issue
Block a user