File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
src/main/java/com/rabbitmq/perf Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -182,20 +182,17 @@ public void run(boolean announceStartup)
182182
183183 this .completionHandler .waitForCompletion ();
184184
185- int count = 1 ; // counting the threads
186- for (int i = 0 ; i < producerStates .length ; i ++) {
187- producerStates [i ].task .cancel (true );
188- if (count % params .getProducerChannelCount () == 0 ) {
189- // this is the end of a group of threads on the same connection,
190- // closing the connection
191- try {
192- producerConnections [count / params .getProducerChannelCount () - 1 ].close ();
193- } catch (Exception e ) {
194- // don't do anything, we need to close the other connections
195- }
185+ for (AgentState producerState : producerStates ) {
186+ producerState .task .cancel (true );
187+ }
196188
189+ for (Connection producerConnection : producerConnections ) {
190+ try {
191+ producerConnection .close ();
192+ } catch (Exception e ) {
193+ // don't do anything, we need to close the other connections
197194 }
198- count ++;
195+
199196 }
200197
201198 for (Connection consumerConnection : consumerConnections ) {
You can’t perform that action at this time.
0 commit comments