From f09e8abbf20de622d83e661bf92f65e3e748d644 Mon Sep 17 00:00:00 2001 From: marcsello Date: Fri, 23 Oct 2020 16:48:27 +0200 Subject: [PATCH] Fixed pairing --- benchmark3.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/benchmark3.py b/benchmark3.py index 4ce74a5..648c1a1 100644 --- a/benchmark3.py +++ b/benchmark3.py @@ -266,11 +266,18 @@ def main(): except queue.Empty: break - try: - benchmark_results[returned_job.id].alert_arrived = returned_job.arrived - except KeyError: + # super ghetto pairing + paired = False + for benchmark_result in benchmark_results: + if benchmark_result.id == returned_job.id: + benchmark_result.alert_arrived = returned_job.arrived + paired = True + break + + if not paired: print("Bruh moment: Alert arrived with an id that's not sent", returned_job.id) + total_answered += 1 # print some mini statistics