RemoteCache: Refactor remote cache settings (#95672)

* refactor remote cache settings

* fix cache error getting treating as application error

* fix cache error getting treating as application error
This commit is contained in:
Jo
2024-11-04 17:35:31 +01:00
committed by GitHub
parent 85c696c4ad
commit ddf766567b
11 changed files with 37 additions and 33 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ func (s *Service) GetAuthInfo(ctx context.Context, query *login.GetAuthInfoQuery
authInfo, err := s.getAuthInfoFromCache(ctx, query)
if err != nil && !errors.Is(err, remotecache.ErrCacheItemNotFound) {
s.logger.Error("failed to retrieve auth info from cache", "error", err)
s.logger.Warn("failed to retrieve auth info from cache", "error", err)
} else if authInfo != nil {
return authInfo, nil
}
@@ -59,7 +59,7 @@ func (s *Service) GetAuthInfo(ctx context.Context, query *login.GetAuthInfoQuery
err = s.setAuthInfoInCache(ctx, query, authInfo)
if err != nil {
s.logger.Error("failed to set auth info in cache", "error", err)
s.logger.Warn("failed to set auth info in cache", "error", err)
} else {
s.logger.Debug("auth info set in cache", "cacheKey", generateCacheKey(query))
}