mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-25 17:43:38 +01:00
Properly handle cache error and return userdata (#1571)
This commit is contained in:
parent
88747e3e01
commit
dd14db6478
@ -1231,14 +1231,12 @@ func (am *DefaultAccountManager) lookupUserInCache(userID string, account *Accou
|
|||||||
|
|
||||||
key := user.IntegrationReference.CacheKey(account.Id, userID)
|
key := user.IntegrationReference.CacheKey(account.Id, userID)
|
||||||
ud, err := am.externalCacheManager.Get(am.ctx, key)
|
ud, err := am.externalCacheManager.Get(am.ctx, key)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
log.Errorf("failed to get externalCache for key: %s, error: %s", key, err)
|
log.Errorf("failed to get externalCache for key: %s, error: %s", key, err)
|
||||||
return ud, status.Errorf(status.NotFound, "user %s not found in the IdP", userID)
|
return nil, status.Errorf(status.NotFound, "user %s not found in the IdP", userID)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("user %s not found in any cache", userID)
|
return ud, nil
|
||||||
|
|
||||||
return nil, nil //nolint:nilnil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (am *DefaultAccountManager) refreshCache(accountID string) ([]*idp.UserData, error) {
|
func (am *DefaultAccountManager) refreshCache(accountID string) ([]*idp.UserData, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user