Closed rddewan closed 2 weeks ago
@rddewan - it looks like you are overrwiting the cache-manager system with Keyv. Is that correct?
If so I believe keyv.set(key, value, ttl)
should work correctly.
I would check these things:
You can see here that we are testing for the ttl to work correctly with Redis. https://github.com/jaredwray/keyv/blob/835e6cbf2789bd5a04e0e8ad538be41cc7c86e49/packages/redis/test/test.ts#L123
Can you send me a unit test that shows with just Keyv
and @keyv/redis
where it is doing the bug you described?
found the issue defaultTTL type was string and had to parse it to number
const defaultTTL = parseInt(configService.get<string>('REDIS_CACHE_TTL', '300000'));
When using it with NestJs Cache Manager TTL is always set as -1