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