Skip to content

Commit a25d24b

Browse files
nickygerritsenvmcj
authored andcommitted
PC^2 does not send timelimits for problems, so make them optional.
1 parent 6d2f85a commit a25d24b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,10 +1024,13 @@ 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,
1028-
'timelimit' => $data->timeLimit,
1027+
'name' => $data->name,
10291028
];
10301029

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

0 commit comments

Comments
 (0)