ensure pypo registers with server before doing Liquidsoap check
This commit is contained in:
parent
ec7eb5f264
commit
3a1048bdec
|
@ -138,11 +138,10 @@ except Exception, e:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
class Global:
|
class Global:
|
||||||
def __init__(self):
|
def __init__(self, api_client):
|
||||||
self.api_client = api_client.AirtimeApiClient()
|
self.api_client = api_client
|
||||||
|
|
||||||
def selfcheck(self):
|
def selfcheck(self):
|
||||||
self.api_client = api_client.AirtimeApiClient()
|
|
||||||
return self.api_client.is_server_compatible()
|
return self.api_client.is_server_compatible()
|
||||||
|
|
||||||
def test_api(self):
|
def test_api(self):
|
||||||
|
@ -186,12 +185,21 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
signal.signal(signal.SIGINT, keyboardInterruptHandler)
|
signal.signal(signal.SIGINT, keyboardInterruptHandler)
|
||||||
|
|
||||||
# initialize
|
api_client = api_client.AirtimeApiClient()
|
||||||
g = Global()
|
g = Global(api_client)
|
||||||
|
|
||||||
while not g.selfcheck():
|
while not g.selfcheck():
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
|
success = False
|
||||||
|
while not success:
|
||||||
|
try:
|
||||||
|
api_client.register_component('pypo')
|
||||||
|
success = True
|
||||||
|
except Exception, e:
|
||||||
|
logger.error(str(e))
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
telnet_lock = Lock()
|
telnet_lock = Lock()
|
||||||
|
|
||||||
ls_host = config['ls_host']
|
ls_host = config['ls_host']
|
||||||
|
@ -204,20 +212,10 @@ if __name__ == '__main__':
|
||||||
g.test_api()
|
g.test_api()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
api_client = api_client.AirtimeApiClient()
|
|
||||||
|
|
||||||
ReplayGainUpdater.start_reply_gain(api_client)
|
ReplayGainUpdater.start_reply_gain(api_client)
|
||||||
SilanAnalyzer.start_silan(api_client, logger)
|
SilanAnalyzer.start_silan(api_client, logger)
|
||||||
|
|
||||||
success = False
|
|
||||||
while not success:
|
|
||||||
try:
|
|
||||||
api_client.register_component('pypo')
|
|
||||||
success = True
|
|
||||||
except Exception, e:
|
|
||||||
logger.error(str(e))
|
|
||||||
time.sleep(10)
|
|
||||||
|
|
||||||
pypoFetch_q = Queue()
|
pypoFetch_q = Queue()
|
||||||
recorder_q = Queue()
|
recorder_q = Queue()
|
||||||
pypoPush_q = Queue()
|
pypoPush_q = Queue()
|
||||||
|
|
Loading…
Reference in New Issue