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.
This commit is contained in:
andrew committed 2024-04-13 22:09:41 -04:00
1 parent d76d911a82
commit 00ca2e524e
1 file changed
+3 -3
+3 -3
View File
@@ -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):