Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 39 additions & 40 deletions webapp/src/Controller/Jury/InternalErrorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,48 +167,47 @@ public function handleAction(Request $request, ?Profiler $profiler, int $errorId
flush();
};
return $this->streamResponse($this->requestStack, function () use ($progressReporter, $internalError) {
$this->em->wrapInTransaction(function () use ($progressReporter, $internalError) {
$internalError->setStatus(InternalErrorStatusType::STATUS_RESOLVED);
$this->dj->setInternalError(
$internalError->getDisabled(),
$internalError->getContest(),
true
);

$this->dj->auditlog('internal_error', $internalError->getErrorid(),
sprintf('internal error: %s', InternalErrorStatusType::STATUS_RESOLVED));

$affectedJudgings = $internalError->getAffectedJudgings();
if (!$affectedJudgings->isEmpty()) {
$skipped = [];
$rejudging = $this->rejudgingService->createRejudging(
'Internal Error ' . $internalError->getErrorid() . ' resolved',
JudgeTask::PRIORITY_DEFAULT,
$affectedJudgings->getValues(),
false,
0,
0,
null,
$skipped,
$progressReporter);
if ($rejudging === null) {
$this->addFlash('warning', 'All submissions that are affected by this internal error are already part of another rejudging.');
} else {
$rejudgingUrl = $this->generateUrl('jury_rejudging', ['rejudgingId' => $rejudging->getRejudgingid()]);
$internalErrorUrl = $this->generateUrl('jury_internal_error', ['errorId' => $internalError->getErrorid()]);
$message = sprintf(
'Rejudging <a href="%s">r%d</a> created for internal error <a href="%s">%d</a>.',
$rejudgingUrl,
$rejudging->getRejudgingid(),
$internalErrorUrl,
$internalError->getErrorid()
);
$progressReporter(100, '', $message);
}
$internalError->setStatus(InternalErrorStatusType::STATUS_RESOLVED);
$this->dj->setInternalError(
$internalError->getDisabled(),
$internalError->getContest(),
true
);
$this->em->flush();

$this->dj->auditlog('internal_error', $internalError->getErrorid(),
sprintf('internal error: %s', InternalErrorStatusType::STATUS_RESOLVED));

$affectedJudgings = $internalError->getAffectedJudgings();
if (!$affectedJudgings->isEmpty()) {
$skipped = [];
$rejudging = $this->rejudgingService->createRejudging(
'Internal Error ' . $internalError->getErrorid() . ' resolved',
JudgeTask::PRIORITY_DEFAULT,
$affectedJudgings->getValues(),
false,
0,
0,
null,
$skipped,
$progressReporter);
if ($rejudging === null) {
$this->addFlash('warning', 'All submissions that are affected by this internal error are already part of another rejudging.');
} else {
$progressReporter(100, '', 'No affected judgings.');
$rejudgingUrl = $this->generateUrl('jury_rejudging', ['rejudgingId' => $rejudging->getRejudgingid()]);
$internalErrorUrl = $this->generateUrl('jury_internal_error', ['errorId' => $internalError->getErrorid()]);
$message = sprintf(
'Rejudging <a href="%s">r%d</a> created for internal error <a href="%s">%d</a>.',
$rejudgingUrl,
$rejudging->getRejudgingid(),
$internalErrorUrl,
$internalError->getErrorid()
);
$progressReporter(100, '', $message);
}
});
} else {
$progressReporter(100, '', 'No affected judgings.');
}
});
}

Expand Down
Loading