diff --git a/app/mix/service/xxljob_tasks.go b/app/mix/service/xxljob_tasks.go index 899f8fa0..5b957451 100644 --- a/app/mix/service/xxljob_tasks.go +++ b/app/mix/service/xxljob_tasks.go @@ -597,12 +597,14 @@ 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())) - if err != nil { - logger.Error("Redis cache fail, err: %v", err) - return fmt.Sprintf("Redis cache fail, err: %v", err) - } + 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...")