summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py
index fbad9f7f..51e93f5a 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py
@@ -41,10 +41,9 @@ class BatchMessage(object):
size = 0
new_batch = []
for msg in self.batch_list:
- if size < chunk_size:
- size += len(json.dumps(msg))
- new_batch.append(msg)
- else:
+ size += len(json.dumps(msg))
+ new_batch.append(msg)
+ if size > chunk_size:
batch_json = json.dumps(new_batch)
response = self.rpc_client.send_msg(batch_json)
if not response: