Added interrupt handler to inflight wait
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-07-26 16:06:31 +02:00
parent c430232df0
commit 423cb1b442

View File

@ -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