Add SSL and availability condition in /servers/surprise (#15)
This commit is contained in:
parent
d0102327c0
commit
1bbe4d3289
|
@ -27,7 +27,13 @@ class Surprise
|
|||
{
|
||||
$redirectUrl = '';
|
||||
|
||||
$sql = 'SELECT base_url FROM server WHERE reg_policy = "REGISTER_OPEN" AND health_score > 75 ORDER BY health_score DESC, RAND()';
|
||||
$sql = 'SELECT `base_url`, server.*
|
||||
FROM `server`
|
||||
WHERE `reg_policy` = "REGISTER_OPEN"
|
||||
AND `health_score` > 75
|
||||
AND `ssl_state`
|
||||
AND `available`
|
||||
ORDER BY `health_score` DESC, RAND()';
|
||||
|
||||
$server = $this->atlas->fetchOne($sql);
|
||||
if ($server) {
|
||||
|
|
Loading…
Reference in a new issue