From 867e9ef3d3d32ba637b52d6c199173f3c384ae09 Mon Sep 17 00:00:00 2001
From: ormancey <emmanuel.ormancey@cern.ch>
Date: Mon, 18 Oct 2021 11:33:18 +0200
Subject: [PATCH] fixed countchannels on restart

---
 Python/stress-testing/stress_testing.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Python/stress-testing/stress_testing.py b/Python/stress-testing/stress_testing.py
index d7ad33e..ad4662a 100644
--- a/Python/stress-testing/stress_testing.py
+++ b/Python/stress-testing/stress_testing.py
@@ -70,7 +70,10 @@ def main(argv):
     channels_reloaded = get_channels_by_prefix(Config.CHANNEL_NAME)
     if channels_reloaded:
         channel_ids = [channel["id"] for channel in channels_reloaded]
-        print("\tfound " + str(len(channel_ids)) + " test channels, continuing...")
+        print("\tfound " + str(len(channel_ids)) + " test channels...")
+        if countchannels < len(channel_ids):
+            channel_ids = channel_ids[0:countchannels]
+        print("\tand continuing with " + str(len(channel_ids)) + " test channels...")
     else:
         channel_ids = []
 
-- 
GitLab