From 00ca2e524e66c81c310d245b5f26ddba8adcb2a3 Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 13 Apr 2024 22:09:41 -0400 Subject: [PATCH] Set Last Report after the request, not before Extremely slow connections can cause a chain of reports without ever meaningfully exhausting the results queue, causing single pairs of results to be reported at a time, until almsot the end of time. --- Client/worker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Client/worker.py b/Client/worker.py index 20d6556..d820690 100644 --- a/Client/worker.py +++ b/Client/worker.py @@ -653,17 +653,16 @@ class ResultsReporter(object): if self.last_report + report_interval > time.time(): return False - # Most recent time we attempted to sent a report is now - self.last_report = time.time() - try: # Heartbeat when no results, or still awaiting bulk results if not self.pending or (self.bulk and not final_report): response = ServerReporter.report_heartbeat(self.config).json() + self.last_report = time.time() else: # Send all of the queued Results at once response = ServerReporter.report_results(self.config, self.pending).json() + self.last_report = time.time() self.pending = [] # If the test ended, kill all tasks @@ -680,6 +679,7 @@ class ResultsReporter(object): except Exception: traceback.print_exc() print ('[Note] Failed to upload results to server...') + self.last_report = time.time() def send_errors(self, timestamp, cutechess_cnt):