(key)
| 42 | } |
| 43 | |
| 44 | async get(key) { |
| 45 | debug('get', { key }); |
| 46 | try { |
| 47 | await this.queue.enqueue(key); |
| 48 | const res = await this.client.get(key); |
| 49 | if (!res) { |
| 50 | return null; |
| 51 | } |
| 52 | return JSON.parse(res); |
| 53 | } catch (err) { |
| 54 | logger.error('RedisCacheAdapter error on get', { error: err }); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | async put(key, value, ttl = this.ttl) { |
| 59 | value = JSON.stringify(value); |