Skip to content

Commit

Permalink
video mqbug修改
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxianloveqiqi committed Nov 7, 2023
1 parent ac2fca1 commit d187b8f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/video/mq/internal/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,22 @@ func (s *Service) consume(ch chan *model.Video) {
// 全部视频时序排序
err := s.RedisClient.ZAdd(s.ctx, consts.VideoTimeScore, redis.Z{
Score: float64(v.CreateTime.Unix()),
Member: m.Id,
Member: v.Id,
}).Err()

return err
}, func() error {
// 全部视频热度排序
err := s.RedisClient.ZAdd(s.ctx, consts.VideoHotScore, redis.Z{
Score: float64(v.CreateTime.Unix()) * 0.5,
Member: m.Id,
Member: v.Id,
}).Err()
return err
}, func() error {
// 用户所有视频时序排序
err := s.RedisClient.ZAdd(s.ctx, consts.VideoEveryUserTimeScore+fmt.Sprint(m.UserId), redis.Z{
Score: float64(v.CreateTime.Unix()),
Member: m.Id,
Member: v.Id,
}).Err()
return err
}, func() error {
Expand All @@ -131,14 +131,14 @@ func (s *Service) consume(ch chan *model.Video) {
// 分区所有视频时序排序
err := s.RedisClient.ZAdd(s.ctx, consts.VideoPartitionTimeScore+fmt.Sprint(m.Partition), redis.Z{
Score: float64(v.CreateTime.Unix()),
Member: m.Id,
Member: v.Id,
}).Err()
return err
}, func() error {
// 分区所有视频热度排序
err := s.RedisClient.ZAdd(s.ctx, consts.VideoPartitionHotScore+fmt.Sprint(m.Partition), redis.Z{
Score: float64(v.CreateTime.Unix()) * 0.5,
Member: m.Id,
Member: v.Id,
}).Err()
return err
})
Expand Down

0 comments on commit d187b8f

Please sign in to comment.