|
|
@ -24,7 +24,6 @@ var ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func NewRedis() *redis.Client { |
|
|
|
func NewRedis() *redis.Client { |
|
|
|
|
|
|
|
|
|
|
|
once.Do(func() { |
|
|
|
once.Do(func() { |
|
|
|
redisConfig := &cproto.Redis{} |
|
|
|
redisConfig := &cproto.Redis{} |
|
|
|
_ = configv2.Get(configv2.Redis, redisConfig) |
|
|
|
_ = configv2.Get(configv2.Redis, redisConfig) |
|
|
@ -51,6 +50,7 @@ func NewTask() { |
|
|
|
|
|
|
|
|
|
|
|
func task(start, end int64) error { |
|
|
|
func task(start, end int64) error { |
|
|
|
redisClient := NewRedis() |
|
|
|
redisClient := NewRedis() |
|
|
|
|
|
|
|
defer func() { redisClient.Close() }() |
|
|
|
result, err := redisClient.ZRangeWithScores(context.Background(), hotKey, start, end).Result() |
|
|
|
result, err := redisClient.ZRangeWithScores(context.Background(), hotKey, start, end).Result() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|