Set an item in the redis cache
(ctx context.Context, key string, value string, ttl time.Duration)
| 42 | |
| 43 | // Set an item in the redis cache |
| 44 | func (cache *redisCache) Set(ctx context.Context, key string, value string, ttl time.Duration) error { |
| 45 | ctx, span := cache.tracer.Start(ctx) |
| 46 | defer span.End() |
| 47 | |
| 48 | err := cache.client.Set(ctx, key, value, ttl).Err() |
| 49 | if err != nil { |
| 50 | return cache.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, "cannot set item in redis")) |
| 51 | } |
| 52 | return nil |
| 53 | } |
nothing calls this directly
no test coverage detected