updateUserCache updates all user cache fields using hash
(user User)
| 65 | |
| 66 | // updateUserCache updates all user cache fields using hash |
| 67 | func updateUserCache(user User) error { |
| 68 | if !common.RedisEnabled { |
| 69 | return nil |
| 70 | } |
| 71 | |
| 72 | return common.RedisHSetObj( |
| 73 | getUserCacheKey(user.Id), |
| 74 | user.ToBaseUser(), |
| 75 | time.Duration(common.RedisKeyCacheSeconds())*time.Second, |
| 76 | ) |
| 77 | } |
| 78 | |
| 79 | // GetUserCache gets complete user cache from hash |
| 80 | func GetUserCache(userId int) (userCache *UserBase, err error) { |
no test coverage detected