Skip to content

Commit 865ff12

Browse files
committed
Revert "PC^2 does not send timelimits for problems, so make them optional."
We want to follow the spec and not be lenient for this import error. We have a separate branch for the customizations for PC2 so when we shadow them we can easily cherry-pick those. This reverts commit a25d24b.
1 parent 5d04d16 commit 865ff12

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

webapp/src/DataTransferObject/Shadowing/ProblemEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class ProblemEvent implements EventData
77
public function __construct(
88
public readonly string $id,
99
public readonly string $name,
10-
public readonly ?int $timeLimit,
10+
public readonly int $timeLimit,
1111
public readonly ?string $label,
1212
public readonly ?string $rgb,
1313
) {}

webapp/src/Service/ExternalContestSourceService.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,13 +1024,10 @@ protected function validateAndUpdateProblem(Event $event, EventData $data): void
10241024
$this->removeWarning($event->type, $data->id, ExternalSourceWarning::TYPE_ENTITY_NOT_FOUND);
10251025

10261026
$toCheckProblem = [
1027-
'name' => $data->name,
1027+
'name' => $data->name,
1028+
'timelimit' => $data->timeLimit,
10281029
];
10291030

1030-
if ($data->timeLimit !== null) {
1031-
$toCheckProblem['timelimit'] = $data->timeLimit;
1032-
}
1033-
10341031
if ($contestProblem->getShortname() !== $data->label) {
10351032
$this->logger->warning(
10361033
'Contest problem short name does not match between feed (%s) and local (%s), updating',

0 commit comments

Comments
 (0)