Fix setting minscore - initialized to 0 (#1725)

Signed-off-by: shishir gowda <shishir@livekit.io>
This commit is contained in:
shishirng
2023-05-19 11:00:32 -04:00
committed by GitHub
parent 0bb89575eb
commit 3de51181ec
+3 -1
View File
@@ -159,7 +159,9 @@ func coalesce(stats []*livekit.AnalyticsStat) *livekit.AnalyticsStat {
// only consider non-zero scores
if stat.Score > 0 {
if stat.Score < minScore {
if minScore == 0 {
minScore = stat.Score
} else if stat.Score < minScore {
minScore = stat.Score
}
scoreSum += stat.Score