CC-5049:
Error messages on Liquidsoap start up/shut down after Airtime install Suppress global warning messages. Clients should decide whether to print or not.
This commit is contained in:
parent
16bd407136
commit
ca37ec3aff
2 changed files with 11 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
import logging
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
from api_clients.api_client import AirtimeApiClient
|
||||
|
||||
def generate_liquidsoap_config(ss):
|
||||
|
@ -26,19 +27,21 @@ def generate_liquidsoap_config(ss):
|
|||
fh.close()
|
||||
|
||||
logging.basicConfig(format='%(message)s')
|
||||
ac = AirtimeApiClient(logging.getLogger())
|
||||
attempts = 0
|
||||
max_attempts = 5
|
||||
max_attempts = 10
|
||||
successful = False
|
||||
|
||||
while True:
|
||||
while not successful:
|
||||
try:
|
||||
ac = AirtimeApiClient(logging.getLogger())
|
||||
ss = ac.get_stream_setting()
|
||||
generate_liquidsoap_config(ss)
|
||||
break
|
||||
successful = True
|
||||
except Exception, e:
|
||||
if attempts == max_attempts:
|
||||
print "Unable to connect to the Airtime server."
|
||||
logging.error(str(e))
|
||||
logging.error("traceback: %s", traceback.format_exc())
|
||||
sys.exit(1)
|
||||
else:
|
||||
time.sleep(3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue