invalidateUserCache clears user cache
(userId int)
| 61 | |
| 62 | // invalidateUserCache clears user cache |
| 63 | func invalidateUserCache(userId int) error { |
| 64 | if !common.RedisEnabled { |
| 65 | return nil |
| 66 | } |
| 67 | return common.RedisDelKey(getUserCacheKey(userId)) |
| 68 | } |
| 69 | |
| 70 | // InvalidateUserCache is the exported version of invalidateUserCache. |
| 71 | // 供 controller 等上层包在用户状态变更(如禁用、删除、角色变更)后主动清理缓存。 |
no test coverage detected