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