mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-19 11:36:57 +00:00
Make it possible to actually use redis for caching through the config flags
This commit is contained in:
parent
c4181d1206
commit
e1a22d5f4c
5 changed files with 37 additions and 12 deletions
8
server/cache/redis.go
vendored
8
server/cache/redis.go
vendored
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue