From d1b1a62b8aa4d85862106d31c4ea020c45d52dd6 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Mon, 20 May 2024 17:32:12 +0800 Subject: [PATCH] by Robin at 20240520 --- app/mix/service/utilservice.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index 2f15ecac..007254a9 100644 --- a/app/mix/service/utilservice.go +++ b/app/mix/service/utilservice.go @@ -1191,6 +1191,9 @@ func (s *Service) utilGetStreamerRecommListVO(ctx *gin.Context, recommlist []int // 向下操作,去尾 upperBound := int64(consts.StreamerRecommThroughput) + if len(recommlist) < consts.StreamerRecommThroughput { + upperBound = int64(len(recommlist)) + } if opType == consts.Recomm_Down { surplusVolume := recommListLength - offset if surplusVolume < consts.StreamerRecommThroughput {