-handle case gracefully when pypo hasn't registered with Airtime server yet.

This commit is contained in:
Martin Konecny 2012-02-12 01:34:53 -05:00
parent ccd843a35a
commit 5059d13156
1 changed files with 18 additions and 10 deletions

View File

@ -120,6 +120,9 @@ class Application_Model_Systemstatus
public static function GetPypoStatus(){ public static function GetPypoStatus(){
$component = CcServiceRegisterQuery::create()->findOneByDbName("pypo"); $component = CcServiceRegisterQuery::create()->findOneByDbName("pypo");
if (is_null($component)){
return null;
} else {
$ip = $component->getDbIp(); $ip = $component->getDbIp();
$docRoot = self::GetMonitStatus($ip); $docRoot = self::GetMonitStatus($ip);
@ -127,10 +130,14 @@ class Application_Model_Systemstatus
return $data; return $data;
} }
}
public static function GetLiquidsoapStatus(){ public static function GetLiquidsoapStatus(){
$component = CcServiceRegisterQuery::create()->findOneByDbName("pypo"); $component = CcServiceRegisterQuery::create()->findOneByDbName("pypo");
if (is_null($component)){
return null;
} else {
$ip = $component->getDbIp(); $ip = $component->getDbIp();
$docRoot = self::GetMonitStatus($ip); $docRoot = self::GetMonitStatus($ip);
@ -138,6 +145,7 @@ class Application_Model_Systemstatus
return $data; return $data;
} }
}
public static function GetShowRecorderStatus(){ public static function GetShowRecorderStatus(){