File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ func (t *Test) Start() <-chan queue.RegionsAggData {
7272}
7373
7474func (t * Test ) invokeLambdas (awsConfig * aws.Config , sqsURL string ) {
75- lambdas := numberOfLambdas (t .config .Concurrency )
75+ lambdas := numberOfLambdas (t .config .Concurrency , len ( t . config . Regions ) )
7676
7777 for i := 0 ; i < lambdas ; i ++ {
7878 region := t .config .Regions [i % len (t .config .Regions )]
@@ -115,10 +115,16 @@ func (t *Test) invokeLambda(awsConfig *aws.Config, args invokeArgs) {
115115 })
116116}
117117
118- func numberOfLambdas (concurrency uint ) int {
118+ func numberOfLambdas (concurrency uint , numRegions int ) int {
119+ if numRegions > int (concurrency ) {
120+ return int (concurrency )
121+ }
119122 if concurrency / 10 > 100 {
120123 return 100
121124 }
125+ if int (concurrency ) < 10 * numRegions {
126+ return numRegions
127+ }
122128 return int (concurrency - 1 )/ 10 + 1
123129}
124130
You can’t perform that action at this time.
0 commit comments