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
|
@ -93,10 +93,10 @@ generate_range_url = 'generate_range_dp.php'
|
|||
get_stream_setting = 'get-stream-setting/format/json/api_key/%%api_key%%/'
|
||||
|
||||
#URL to update liquidsoap error msg
|
||||
update_liquidsoap_error = 'update-liquidsoap-error/format/json/api_key/%%api_key%%/error_msg/%%error_msg%%/stream_id/%%stream_id%%'
|
||||
update_liquidsoap_error = 'update-liquidsoap-error/format/json/api_key/%%api_key%%/error_msg/%%error_msg%%/stream_id/%%stream_id%%/boot_time/%%boot_time%%'
|
||||
|
||||
#URL to update liquidsoap connection
|
||||
update_liquidsoap_connection = 'update-liquidsoap-connection/format/json/api_key/%%api_key%%/stream_id/%%stream_id%%'
|
||||
update_liquidsoap_connection = 'update-liquidsoap-connection/format/json/api_key/%%api_key%%/stream_id/%%stream_id%%/boot_time/%%boot_time%%'
|
||||
|
||||
##############
|
||||
# OBP config #
|
||||
|
|
|
@ -571,7 +571,7 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
except Exception, e:
|
||||
logger.error("Exception: %s", e)
|
||||
|
||||
def notify_liquidsoap_error(self, error_msg, stream_id):
|
||||
def notify_liquidsoap_error(self, error_msg, stream_id, time):
|
||||
logger = logging.getLogger()
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_liquidsoap_error"])
|
||||
|
@ -581,19 +581,21 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
encoded_msg = urllib.quote(error_msg, '')
|
||||
url = url.replace("%%error_msg%%", encoded_msg)
|
||||
url = url.replace("%%stream_id%%", stream_id)
|
||||
url = url.replace("%%boot_time%%", time)
|
||||
logger.debug(url)
|
||||
req = urllib2.Request(url)
|
||||
response = urllib2.urlopen(req).read()
|
||||
except Exception, e:
|
||||
logger.error("Exception: %s", e)
|
||||
|
||||
def notify_liquidsoap_connection(self, stream_id):
|
||||
def notify_liquidsoap_connection(self, stream_id, time):
|
||||
logger = logging.getLogger()
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["update_liquidsoap_connection"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = url.replace("%%stream_id%%", stream_id)
|
||||
url = url.replace("%%boot_time%%", time)
|
||||
logger.debug(url)
|
||||
req = urllib2.Request(url)
|
||||
response = urllib2.urlopen(req).read()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue