Skip to content

Commit

Permalink
Only send judging event when data changed.
Browse files Browse the repository at this point in the history
We would be sending a judging event for every testcase we ran after a verdict has been determined otherwise.
  • Loading branch information
nickygerritsen committed Aug 17, 2023
1 parent e300dc0 commit 38a3ea9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion webapp/src/Controller/API/JudgehostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 38a3ea9

Please sign in to comment.