From 6e35a77268113165bc39691e97a5b623c5396a53 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 7 Jun 2011 16:54:38 -0400 Subject: [PATCH] CC-2376: pypo-push thread sys.exits when exception is raised. --- python_apps/pypo/pypopush.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index 573770694..d7a273b55 100755 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -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