Skip to content

Commit 80c1a43

Browse files
committed
When cancelling a rejudging, also delete the corresponding queue tasks.
Previously, when you did a large rejudging (say of a whole contest), abort it immediately, you would have a lot of queuetasks where each queue task doesn't have any remaining judge task to process. The judgedaemon would process these one at a time and assume there is no work to be done and sleep until processing the next one, so it would take hours to clean up the queue. We should address that behavior separately.
1 parent 99417fa commit 80c1a43

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

webapp/src/Service/RejudgingService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ public function finishRejudging(Rejudging $rejudging, string $action, ?callable
335335
SET result = :aborted
336336
WHERE judgingid = :judgingid
337337
AND result IS NULL', ['aborted' => 'aborted', 'judgingid' => $submission['judgingid']]);
338+
$this->em->getConnection()->executeQuery(
339+
'DELETE FROM queuetask WHERE judgingid = :judgingid', ['judgingid' => $submission['judgingid']]);
338340
} else {
339341
$error = "Unknown action '$action' specified.";
340342
throw new BadMethodCallException($error);

0 commit comments

Comments
 (0)