invalidateUserCache clears user cache
(userId int)
| 51 | |
| 52 | // invalidateUserCache clears user cache |
| 53 | func invalidateUserCache(userId int) error { |
| 54 | if !common.RedisEnabled { |
| 55 | return nil |
| 56 | } |
| 57 | return common.RedisDelKey(getUserCacheKey(userId)) |
| 58 | } |
| 59 | |
| 60 | // InvalidateUserCache is the exported version of invalidateUserCache. |
| 61 | // 供 controller 等上层包在用户状态变更(如禁用、删除、角色变更)后主动清理缓存。 |
no test coverage detected