Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix judgehost check if its enabled #2742

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Fix judgehost check if its enabled #2742

merged 1 commit into from
Oct 22, 2024

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Oct 13, 2024

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.

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)
  }
}
```
@vmcj vmcj requested a review from meisterT October 13, 2024 12:22
@vmcj vmcj added this pull request to the merge queue Oct 22, 2024
Merged via the queue into main with commit f6b66cf Oct 22, 2024
30 checks passed
@vmcj vmcj deleted the judgehost-fix-enabled-check branch October 22, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants