(key: string, value: any, ttl?: number)
| 41 | } |
| 42 | |
| 43 | async set(key: string, value: any, ttl?: number) { |
| 44 | try { |
| 45 | await this.client.setEx(this.buildKey(key), ttl || this.conf?.TTL, JSON.stringify(value)); |
| 46 | } catch (error) { |
| 47 | this.logger.error(error); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | async hSet(key: string, field: string, value: any) { |
| 52 | try { |