(key: string, value: TData, opts?: { ttl?: number })
| 24 | } |
| 25 | |
| 26 | async set<TData>(key: string, value: TData, opts?: { ttl?: number }): Promise<"OK" | TData | null> { |
| 27 | return this.redis.set( |
| 28 | key, |
| 29 | value, |
| 30 | opts?.ttl |
| 31 | ? { |
| 32 | px: opts.ttl, |
| 33 | } |
| 34 | : undefined |
| 35 | ); |
| 36 | } |
| 37 | |
| 38 | async expire(key: string, seconds: number): Promise<0 | 1> { |
| 39 | // Implementation for setting expiration time for key in Redis |
no outgoing calls