From f1c77845eafc6969b674fa05c9ccca01ebca69af Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 9 Sep 2011 14:49:12 -0400 Subject: [PATCH] CC-2783: Investigate Pypo taking 100% CPU on production system -fixed --- python_apps/pypo/pypopush.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index cbce20e43..21d2a42b9 100644 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -41,13 +41,7 @@ class PypoPush(Thread): self.playlists = dict() self.stream_metadata = dict() - """ - push_ahead2 MUST be < push_ahead. The difference in these two values - gives the number of seconds of the window of opportunity for the scheduler - to catch when a playlist is to be played. - """ self.push_ahead = 10 - self.push_ahead2 = self.push_ahead -5 #toggle between "stop" and "play". Keeps track of the state of #liquidsoap @@ -86,16 +80,13 @@ class PypoPush(Thread): tcoming = time.localtime(timenow + self.push_ahead) str_tcoming_s = "%04d-%02d-%02d-%02d-%02d-%02d" % (tcoming[0], tcoming[1], tcoming[2], tcoming[3], tcoming[4], tcoming[5]) - tcoming2 = time.localtime(timenow + self.push_ahead2) - str_tcoming2_s = "%04d-%02d-%02d-%02d-%02d-%02d" % (tcoming2[0], tcoming2[1], tcoming2[2], tcoming2[3], tcoming2[4], tcoming2[5]) - tnow = time.localtime(timenow) str_tnow_s = "%04d-%02d-%02d-%02d-%02d-%02d" % (tnow[0], tnow[1], tnow[2], tnow[3], tnow[4], tnow[5]) for pkey in schedule: plstart = schedule[pkey]['start'][0:19] - if plstart == str_tcoming_s or (plstart < str_tcoming_s and plstart > str_tcoming2_s): + if str_tnow_s <= plstart and plstart < str_tcoming_s: logger.debug('Preparing to push playlist scheduled at: %s', pkey) playlist = schedule[pkey]