(pid string, value any, ttl time.Duration)
| 24 | } |
| 25 | |
| 26 | func (c *KeysCache) Set(pid string, value any, ttl time.Duration) error { |
| 27 | ctx, cancel := context.WithTimeout(context.Background(), c.wt) |
| 28 | defer cancel() |
| 29 | err := c.client.Set(ctx, pid, value, ttl).Err() |
| 30 | if err != nil { |
| 31 | return err |
| 32 | } |
| 33 | |
| 34 | return nil |
| 35 | } |
| 36 | |
| 37 | func (c *KeysCache) Delete(pid string) error { |
| 38 | ctx, cancel := context.WithTimeout(context.Background(), c.wt) |