(key: string, field: string)
| 21 | } |
| 22 | |
| 23 | public async hGet(key: string, field: string) { |
| 24 | if (!this.cache) { |
| 25 | return null; |
| 26 | } |
| 27 | try { |
| 28 | const data = await this.cache.hGet(key, field); |
| 29 | |
| 30 | if (data) { |
| 31 | return JSON.parse(data, BufferJSON.reviver); |
| 32 | } |
| 33 | |
| 34 | return null; |
| 35 | } catch (error) { |
| 36 | this.logger.error(error); |
| 37 | return null; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | async set(key: string, value: any, ttl?: number) { |
| 42 | if (!this.cache) { |