Commit 166fc347 authored by David Morley's avatar David Morley

fix for pods that have gone offline recently from go random select

parent 9fa752ef
Pipeline #937 passed with stage
in 43 seconds
...@@ -9,6 +9,15 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic ...@@ -9,6 +9,15 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
### Fixed ### Fixed
### Security ### Security
## [2.5.x]
### Added
### Changed
### Deprecated
### Removed
### Fixed
- go.php will only use online pods
### Security
## [2.5.1] - 2018-12-09 ## [2.5.1] - 2018-12-09
### Changed ### Changed
- use file_get_contents less and prefer curl and copy to make things more stable - use file_get_contents less and prefer curl and copy to make things more stable
......
...@@ -9,6 +9,7 @@ declare(strict_types=1); ...@@ -9,6 +9,7 @@ declare(strict_types=1);
use Carbon\Carbon; use Carbon\Carbon;
use Jaybizzle\CrawlerDetect\CrawlerDetect; use Jaybizzle\CrawlerDetect\CrawlerDetect;
use RedBeanPHP\R; use RedBeanPHP\R;
use Poduptime\PodStatus;
// Other parameters. // Other parameters.
$_domain = $_GET['domain'] ?? ''; $_domain = $_GET['domain'] ?? '';
...@@ -30,9 +31,10 @@ try { ...@@ -30,9 +31,10 @@ try {
AND uptime_alltime > 95 AND uptime_alltime > 95
AND monthsmonitored > 1 AND monthsmonitored > 1
AND softwarename = ? AND softwarename = ?
AND status = ?
ORDER BY random() ORDER BY random()
LIMIT 1 LIMIT 1
', [$_software]); ', [$_software, PodStatus::UP]);
$domain || die('no domains exist'); $domain || die('no domains exist');
} else { } else {
$click = 'autoclick'; $click = 'autoclick';
...@@ -43,9 +45,10 @@ try { ...@@ -43,9 +45,10 @@ try {
AND uptime_alltime > 96 AND uptime_alltime > 96
AND monthsmonitored > 2 AND monthsmonitored > 2
AND pods.masterversion = shortversion AND pods.masterversion = shortversion
AND status = ?
ORDER BY random() ORDER BY random()
LIMIT 1 LIMIT 1
'); ', [PodStatus::UP]);
$domain || die('no domains exist'); $domain || die('no domains exist');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment