Make it possible to actually use redis for caching through the config flags

This commit is contained in:
Moritz Marquardt 2024-03-26 07:47:39 +01:00
parent c4181d1206
commit e1a22d5f4c
5 changed files with 37 additions and 12 deletions

View file

@ -36,13 +36,9 @@ func (r *RedisCache) Remove(key string) {
}
}
func NewRedisCache() ICache {
func NewRedisCache(opts *redis.Options) ICache {
return &RedisCache{
context.Background(),
redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "", // no password set
DB: 0, // use default DB
}),
redis.NewClient(opts),
}
}