Browse Source

Update healthChecks.php

Updates to _healthCheckPluginRun() and _healthCheckPluginUUID to properly pass the result of $pass and allow sending of "/fail" to tell Healthchecks.io that the job has failed in real-time.
Jesse Hickman 5 years ago
parent
commit
2985ee2ee7
1 changed files with 3 additions and 3 deletions
  1. 3 3
      api/plugins/healthChecks.php

+ 3 - 3
api/plugins/healthChecks.php

@@ -72,7 +72,7 @@ class HealthChecks extends Organizr
 	
 	public function _healthCheckPluginUUID($uuid, $pass = false)
 	{
-		if (!$uuid || !$pass || $this->config['HEALTHCHECKS-PingURL'] == '') {
+		if (!$uuid || $this->config['HEALTHCHECKS-PingURL'] == '') {
 			return false;
 		}
 		$url = $this->qualifyURL($this->config['HEALTHCHECKS-PingURL']);
@@ -134,11 +134,11 @@ class HealthChecks extends Organizr
 						$pass = true;
 					}
 				}
-				$this->_healthCheckPluginUUID($v['UUID'], 'true');
+				$this->_healthCheckPluginUUID($v['UUID'], $pass);
 			}
 			$this->setAPIResponse('success', null, 200, $allItems);
 		} else {
 			$this->setAPIResponse('error', 'User does not have access', 401);
 		}
 	}
-}
+}