by Robin at 20240624
This commit is contained in:
parent
900a803525
commit
5fcfea53ab
|
@ -597,13 +597,15 @@ func (s *CronService) ReloadBlockedFromBeingSearchedList(ctx context.Context, pa
|
|||
}
|
||||
|
||||
// 加载缓存
|
||||
blockedlist := make([]string, 0)
|
||||
for _, acctpunishment := range list {
|
||||
err := redis.GetRedisClient().RPush(consts.RedisStreamerPrefix+"blocked_from_being_searched_list", fmt.Sprint(acctpunishment.GetMid()))
|
||||
blockedlist = append(blockedlist, fmt.Sprint(acctpunishment.GetMid()))
|
||||
}
|
||||
err = redis.GetRedisClient().Set(consts.RedisStreamerPrefix+"blocked_from_being_searched_list", blockedlist, 0)
|
||||
if err != nil {
|
||||
logger.Error("Redis cache fail, err: %v", err)
|
||||
return fmt.Sprintf("Redis cache fail, err: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
logger.Info("Refresh blocked-from-being-searched list cached in redis accomplished...")
|
||||
return "Refresh blocked-from-being-searched list cached in redis accomplished"
|
||||
|
|
Loading…
Reference in New Issue