diff --git a/benchmark2.py b/benchmark2.py index 137b01a..33774d4 100644 --- a/benchmark2.py +++ b/benchmark2.py @@ -337,10 +337,13 @@ def run_benchmark( total_successful_uploads = len([req for req in results.values() if req.upload_status_code == 200]) # Wait for inflight messages for a little - for _ in range(int(inflight_timeout)): - time.sleep(1) - if returned_queue.qsize() >= total_successful_uploads: - break + try: + for _ in range(int(inflight_timeout)): + time.sleep(1) + if returned_queue.qsize() >= total_successful_uploads: + break + except KeyboardInterrupt: + print("jovan akkor nem vĂ¡rom meg...") mqtt_client.disconnect() mqtt_client.loop_stop() # This stops further recieving MQTT messages