Changeset - 32cae9be6c15
[Not reviewed]
default
0 1 0
Drew Perttula - 11 years ago 2014-06-13 09:04:07
drewp@bigasterisk.com
timeout error includes lag
Ignore-this: 551b168d487eb3dd6e9d00edd8f43a3e
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/effecteval/effectloop.py
Show inline comments
 
@@ -51,13 +51,13 @@ class EffectLoop(object):
 
    @inlineCallbacks
 
    def getSongTime(self):
 
        now = time.time()
 

	
 
        if now - self.requestTime > self.coastSecs:
 
        old = now - self.requestTime
 
        if old > self.coastSecs:
 
            try:
 
                response = json.loads((yield cyclone.httpclient.fetch(
 
                    networking.musicPlayer.path('time'), timeout=.5)).body)
 
            except TimeoutError as e:
 
                log.warning("%r, using stale time", e)
 
            except TimeoutError:
 
                log.warning("TimeoutError: using stale time from %.1f ago", old)
 
            else:
 
                self.requestTime = now
 
                self.currentPlaying = response['playing']
0 comments (0 inline, 0 general)