From 38a3ea990d6b80ec243f8a33d0f00ecb0bf4ff4d Mon Sep 17 00:00:00 2001 From: Nicky Gerritsen Date: Mon, 14 Aug 2023 18:45:13 +0200 Subject: [PATCH] Only send judging event when data changed. We would be sending a judging event for every testcase we ran after a verdict has been determined otherwise. --- webapp/src/Controller/API/JudgehostController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/src/Controller/API/JudgehostController.php b/webapp/src/Controller/API/JudgehostController.php index 0b197c00bd..05e4df2e94 100644 --- a/webapp/src/Controller/API/JudgehostController.php +++ b/webapp/src/Controller/API/JudgehostController.php @@ -1001,11 +1001,13 @@ private function addSingleJudgingRun( break; } } + $sendJudgingEvent = false; if (!$hasNullResults || $lazyEval != DOMJudgeService::EVAL_FULL) { // NOTE: setting endtime here determines in testcases_GET // whether a next testcase will be handed out. $judging->setEndtime(Utils::now()); $this->maybeUpdateActiveJudging($judging); + $sendJudgingEvent = true; } $this->em->flush(); @@ -1062,7 +1064,7 @@ private function addSingleJudgingRun( } // Send an event for an endtime (and max runtime update). - if ($judging->getValid()) { + if ($sendJudgingEvent) { $this->eventLogService->log('judging', $judging->getJudgingid(), EventLogService::ACTION_UPDATE, $judging->getContest()->getCid()); }