@@ -2180,7 +2180,7 @@ func clientScoreLocationGroupSampleKey(forceMinimum bool, rankMode RankMode, loc
21802180 return fmt .Sprintf ("css_%d_%c_g_%s_%s_%d" , fm , rm , locationGroupId , callerLocationId , index )
21812181}
21822182
2183- func UpdateClientScores (ctx context.Context , ttl time.Duration ) (returnErr error ) {
2183+ func UpdateClientScores (ctx context.Context , ttl time.Duration , parallel int ) (returnErr error ) {
21842184 addClientScore := func (lookbackClientScore * ClientScore , m map [server.Id ]* ClientScore ) * ClientScore {
21852185 clientScore , ok := m [lookbackClientScore .ClientId ]
21862186 if ! ok {
@@ -2669,16 +2669,15 @@ func UpdateClientScores(ctx context.Context, ttl time.Duration) (returnErr error
26692669 }
26702670 clientLocationIds = append (clientLocationIds , maps .Values (countryCodeLocationIds ())... )
26712671
2672- n := 48
2673- m := (len (clientLocationIds ) + n - 1 ) / n
2672+ m := (len (clientLocationIds ) + parallel - 1 ) / parallel
26742673 allBlockClientLocationIds := [][]server.Id {}
26752674 for i := 0 ; i < len (clientLocationIds ); i += m {
26762675 allBlockClientLocationIds = append (allBlockClientLocationIds , clientLocationIds [i :min (len (clientLocationIds ), i + m )])
26772676 }
26782677
26792678 var wg sync.WaitGroup
26802679 var exportCount atomic.Uint32
2681- returnErrs := make (chan error , n )
2680+ returnErrs := make (chan error , parallel )
26822681
26832682 for i := 0 ; i < len (clientLocationIds ); i += m {
26842683 blockClientLocationIds := clientLocationIds [i :min (len (clientLocationIds ), i + m )]
0 commit comments