From 166fc347aa1cd2995d4aa2725db635fc144a9efe Mon Sep 17 00:00:00 2001 From: david Date: Sat, 29 Dec 2018 09:56:41 -0800 Subject: [PATCH] fix for pods that have gone offline recently from go random select --- CHANGELOG.md | 9 +++++++++ go.php | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7f2a5..8ec75fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,15 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic ### Fixed ### Security +## [2.5.x] +### Added +### Changed +### Deprecated +### Removed +### Fixed +- go.php will only use online pods +### Security + ## [2.5.1] - 2018-12-09 ### Changed - use file_get_contents less and prefer curl and copy to make things more stable diff --git a/go.php b/go.php index c4dbaa0..fd9d24e 100644 --- a/go.php +++ b/go.php @@ -9,6 +9,7 @@ declare(strict_types=1); use Carbon\Carbon; use Jaybizzle\CrawlerDetect\CrawlerDetect; use RedBeanPHP\R; +use Poduptime\PodStatus; // Other parameters. $_domain = $_GET['domain'] ?? ''; @@ -30,9 +31,10 @@ try { AND uptime_alltime > 95 AND monthsmonitored > 1 AND softwarename = ? + AND status = ? ORDER BY random() LIMIT 1 - ', [$_software]); + ', [$_software, PodStatus::UP]); $domain || die('no domains exist'); } else { $click = 'autoclick'; @@ -43,9 +45,10 @@ try { AND uptime_alltime > 96 AND monthsmonitored > 2 AND pods.masterversion = shortversion + AND status = ? ORDER BY random() LIMIT 1 - '); + ', [PodStatus::UP]); $domain || die('no domains exist'); } -- GitLab