CC-3131: Latency of stream authentication warning in Stream Settings page
- it compares boot time of liquidsoap and the time user clicks on "Save" on stream setting page. The status only gets updated if the "boot_time" > "user update time" - as soon as a user click on save, status is set to "wating" - since there is no timing issue, quering interval is reduced to 1 sec
This commit is contained in:
parent
85b8209db9
commit
9c65bfeba7
10 changed files with 71 additions and 29 deletions
|
@ -113,22 +113,29 @@ class Application_Model_StreamSetting {
|
|||
}
|
||||
}
|
||||
|
||||
public static function setLiquidsoapError($stream_id, $msg){
|
||||
/*
|
||||
* Stores liquidsoap status if $boot_time > save time.
|
||||
* save time is the time that user clicked save on stream setting page
|
||||
*/
|
||||
public static function setLiquidsoapError($stream_id, $msg, $boot_time=null){
|
||||
global $CC_DBC;
|
||||
|
||||
$keyname = "s".$stream_id."_liquidsoap_error";
|
||||
$sql = "SELECT COUNT(*) FROM cc_stream_setting"
|
||||
." WHERE keyname = '$keyname'";
|
||||
$result = $CC_DBC->GetOne($sql);
|
||||
if ($result == 1){
|
||||
$sql = "UPDATE cc_stream_setting"
|
||||
." SET value = '$msg'"
|
||||
$update_time = Application_Model_Preference::GetStreamUpdateTimestemp();
|
||||
if($boot_time == null || $boot_time > $update_time ){
|
||||
$keyname = "s".$stream_id."_liquidsoap_error";
|
||||
$sql = "SELECT COUNT(*) FROM cc_stream_setting"
|
||||
." WHERE keyname = '$keyname'";
|
||||
}else{
|
||||
$sql = "INSERT INTO cc_stream_setting (keyname, value, type)"
|
||||
." VALUES ('$keyname', '$msg', 'string')";
|
||||
$result = $CC_DBC->GetOne($sql);
|
||||
if ($result == 1){
|
||||
$sql = "UPDATE cc_stream_setting"
|
||||
." SET value = '$msg'"
|
||||
." WHERE keyname = '$keyname'";
|
||||
}else{
|
||||
$sql = "INSERT INTO cc_stream_setting (keyname, value, type)"
|
||||
." VALUES ('$keyname', '$msg', 'string')";
|
||||
}
|
||||
$res = $CC_DBC->query($sql);
|
||||
}
|
||||
$res = $CC_DBC->query($sql);
|
||||
}
|
||||
|
||||
public static function getLiquidsoapError($stream_id){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue