CC-2376: pypo-push thread sys.exits when exception is raised.

This commit is contained in:
martin 2011-06-07 16:54:38 -04:00
parent 7d51a04082
commit 6e35a77268
1 changed files with 8 additions and 6 deletions

View File

@ -130,13 +130,16 @@ class PypoPush(Thread):
else:
pass
#logger.debug('Empty schedule')
if not currently_on_air and self.liquidsoap_state_play:
logger.debug('Notifying Liquidsoap to stop playback.')
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
tn.write('source.skip\n')
tn.write('exit\n')
tn.read_all()
try:
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
tn.write('source.skip\n')
tn.write('exit\n')
tn.read_all()
except Exception, e:
logger.debug(e)
self.liquidsoap_state_play = False
def push_liquidsoap(self, pkey, schedule, playlists):
@ -233,6 +236,5 @@ class PypoPush(Thread):
try: self.push('scheduler')
except Exception, e:
logger.error('Pypo Push Error, exiting: %s', e)
sys.exit()
time.sleep(PUSH_INTERVAL)
loops += 1