Skip to content

Commit

Permalink
Skip reporting errors when caching user details
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 committed Jul 12, 2021
1 parent 4f8c368 commit 4625fc0
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions pkg/cbox/user/rest/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,11 @@ func (m *manager) cacheUserDetails(u *userpb.User) error {
}

uid, err := extractUID(u)
if err != nil {
return err
}

if err = m.setVal(userPrefix+"uid:"+uid, u.Id.OpaqueId, -1); err != nil {
return err
}
if err = m.setVal(userPrefix+"mail:"+u.Mail, u.Id.OpaqueId, -1); err != nil {
return err
}
if err = m.setVal(userPrefix+"username:"+u.Username, u.Id.OpaqueId, -1); err != nil {
return err
if err == nil {
_ = m.setVal(userPrefix+"uid:"+uid, u.Id.OpaqueId, -1)
}
_ = m.setVal(userPrefix+"mail:"+u.Mail, u.Id.OpaqueId, -1)
_ = m.setVal(userPrefix+"username:"+u.Username, u.Id.OpaqueId, -1)
return nil
}

Expand Down

0 comments on commit 4625fc0

Please sign in to comment.