* Set a value in the cache * @param key - Cache key * @param value - Value to cache (will be JSON stringified for Redis) * @param ttl - Time to live in seconds (0 = no expiration) * @returns boolean indicating success
(key: string, value: any, ttl?: number)
| 30 | * @returns boolean indicating success |
| 31 | */ |
| 32 | async set(key: string, value: any, ttl?: number): Promise<boolean> { |
| 33 | const effectiveTtl = ttl === 0 ? undefined : ttl; |
| 34 | |
| 35 | // Use local cache as fallback or primary |
| 36 | const success = localCache.set(key, value, effectiveTtl || 0); |
| 37 | if (success) { |
| 38 | logger.debug(`Set key in local cache: ${key}`); |
| 39 | } |
| 40 | return success; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Get a value from the cache |
no outgoing calls
no test coverage detected