Move redis config to CacheConfig struct, add cache prefixes & trace logging

This commit is contained in:
Moritz Marquardt 2024-03-29 23:15:08 +01:00
parent e1a22d5f4c
commit 46c8daacba
7 changed files with 45 additions and 30 deletions

View file

@ -31,7 +31,7 @@ func (o *Options) getRedirects(giteaClient *gitea.Client, redirectsCache cache.I
// Check for cached redirects
if cachedValue, ok := redirectsCache.Get(cacheKey); ok {
redirects := []Redirect{}
err := json.Unmarshal(cachedValue, redirects)
err := json.Unmarshal(cachedValue, &redirects)
if err != nil {
log.Error().Err(err).Msgf("could not parse redirects for key %s", cacheKey)
// It's okay to continue, the array stays empty.