From 8cf8a47bbdf4412f20c100debd6e3bb354cbbf91 Mon Sep 17 00:00:00 2001 From: DOMjudge team Date: Sun, 14 Apr 2024 09:36:17 +0200 Subject: [PATCH] CDS does not provide timelimit We disable requiring timelimit in the event feed for the analyst instance. --- webapp/src/DataTransferObject/Shadowing/ProblemEvent.php | 2 +- webapp/src/Service/ExternalContestSourceService.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/webapp/src/DataTransferObject/Shadowing/ProblemEvent.php b/webapp/src/DataTransferObject/Shadowing/ProblemEvent.php index 2aa47e6e27..5294759608 100644 --- a/webapp/src/DataTransferObject/Shadowing/ProblemEvent.php +++ b/webapp/src/DataTransferObject/Shadowing/ProblemEvent.php @@ -7,7 +7,7 @@ class ProblemEvent implements EventData public function __construct( public readonly string $id, public readonly string $name, - public readonly int $timeLimit, + public readonly ?int $timeLimit, public readonly ?string $label, public readonly ?string $rgb, ) {} diff --git a/webapp/src/Service/ExternalContestSourceService.php b/webapp/src/Service/ExternalContestSourceService.php index aab49ee951..c1dcfd2975 100644 --- a/webapp/src/Service/ExternalContestSourceService.php +++ b/webapp/src/Service/ExternalContestSourceService.php @@ -1024,9 +1024,12 @@ protected function validateAndUpdateProblem(Event $event, EventData $data): void $toCheckProblem = [ 'name' => $data->name, - 'timelimit' => $data->timeLimit, ]; + if ($data->timeLimit) { + $toCheckProblem['timelimit'] = $data->timeLimit; + } + if ($contestProblem->getShortname() !== $data->label) { $this->logger->warning( 'Contest problem short name does not match between feed (%s) and local (%s), updating',