Closed RabahZeineddine closed 2 months ago
Describe the bug
After updating the lib to the new v2 version every value is being set inside a v field
v
How To Reproduce (best to provide workable code or tests!) Check my implementation
import { Cache, caching } from 'cache-manager'; import { RedisStore, redisStore } from 'cache-manager-ioredis-yet'; export class MyClass { store: RedisStore; private cacheManager: Cache<RedisStore>; private async getCacheManager() { if (this.cacheManager) return; this.store = await redisStore({ host: this.options.redis.host, db: this.options.redis.db, ttl: this.options.redis.defaultTTL, }); this.cacheManager = await caching(this.store); } async cacheGet<T>(key: string): Promise<T | undefined> { await this.getCacheManager(); return this.cacheManager.get<T>(key); } async cacheSet(key: string, value: unknown, ttl?: number): Promise<void> { if (!ttl) ttl = this.options.redis.defaultTTL ?? 0; await this.getCacheManager(); return this.cacheManager.set(key, value, ttl); } }
After using the cacheSet and cacheGet method, I'm getting this results.
I'm setting a normal number (not an object)
@RabahZeineddine - thanks for creating this bug and we will be looking into this soon.
@RabahZeineddine - this will be deployed in a couple weeks.
Describe the bug
After updating the lib to the new v2 version every value is being set inside a
v
fieldHow To Reproduce (best to provide workable code or tests!) Check my implementation
After using the cacheSet and cacheGet method, I'm getting this results.![Captura de Tela 2024-04-28 às 16 13 36](https://github.com/jaredwray/cache-manager/assets/19435288/04e7ba3e-5465-4ed7-80e7-cd23c9fa51be)
I'm setting a normal number (not an object)