domjudge icon indicating copy to clipboard operation
domjudge copied to clipboard

Fix judgehost check if its enabled

Open vmcj opened this issue 4 months ago • 0 comments

array_filter would only filter out the other judgehosts but still return an array of judgehost objects. By selecting the first (and only item) we can now get the enabled property and properly check.

array(1) {
  [1]=>
  array(5) {
    ["id"]=>
    string(1) "2"
    ["hostname"]=>
    string(8) "judgehost"
    ["enabled"]=>
    bool(true)
    ["polltime"]=>
    string(20) "1728821560.017400000"
    ["hidden"]=>
    bool(false)
  }
}

There is probably a more elegant fix for this but this should work as a quick fix.

vmcj avatar Oct 13 '24 12:10 vmcj