Skip to content

Commit 4603afb

Browse files
committed
Add warning message in case the judgehost is not enabled.
1 parent f1105ea commit 4603afb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

judge/judgedaemon.main.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,14 @@ function fetch_executable_internal(
765765
$lastWorkdir = null;
766766
}
767767
logmsg(LOG_INFO, "No submissions in queue (for endpoint $endpointID), waiting...");
768+
$judgehosts = request('judgehosts', 'GET');
769+
if ($judgehosts !== null) {
770+
$judgehosts = dj_json_decode($judgehosts);
771+
$judgehost = array_filter($judgehosts, fn($j) => $j['hostname'] === $myhost);
772+
if (!isset($judgehost['enabled']) || !$judgehost['enabled']) {
773+
logmsg(LOG_WARNING, "Judgehost needs to be enabled in web interface.");
774+
}
775+
}
768776
}
769777
continue;
770778
}

webapp/src/Controller/API/JudgehostController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function __construct(
7777
*
7878
* @return Judgehost[]
7979
*/
80-
#[IsGranted('ROLE_JURY')]
80+
#[IsGranted(new Expression("is_granted('ROLE_JURY') or is_granted('ROLE_JUDGEHOST')"))]
8181
#[Rest\Get('')]
8282
#[OA\Response(
8383
response: 200,

0 commit comments

Comments
 (0)