v2
This commit is contained in:
@@ -124,6 +124,9 @@ func (s *roleService) List(ctx context.Context, q dto.SearchDto) ([]*system.Role
|
||||
func (s *roleService) RefreshCache(ctx context.Context) error {
|
||||
var res []*system.Role
|
||||
key := know.GetManageKey(ctx, know.AllRoles)
|
||||
if err := s.Redis.Del(ctx, key); err != nil {
|
||||
return err
|
||||
}
|
||||
return util.GetOrSetCache(ctx, s.Redis, key, util.GetCacheExpire(), func() (any, error) {
|
||||
return s.repo.All(ctx)
|
||||
}, &res)
|
||||
|
||||
Reference in New Issue
Block a user