Changeset - ba6594263fa7
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 9 years ago 2016-06-11 21:29:06
drewp@bigasterisk.com
collector: client's prev settings are no longer mixed with its new request. this breaks live page
Ignore-this: 3155a2ab028d9e006ed4796ef8fbf8d0
1 file changed with 13 insertions and 6 deletions:
0 comments (0 inline, 0 general)
light9/collector/collector.py
Show inline comments
 
@@ -75,13 +75,18 @@ class Collector(object):
 
        now = time.time()
 

	
 
        self._forgetStaleClients(now)
 
        row = self.lastRequest.get(client)
 
        if row is not None:
 
            sess, _, prevClientSettings = row
 
            if sess != clientSession:
 

	
 
        if 0: # client updates their past requests?
 
            row = self.lastRequest.get(client)
 
            if row is not None:
 
                sess, _, prevClientSettings = row
 
                if sess != clientSession:
 
                    prevClientSettings = {}
 
            else:
 
                prevClientSettings = {}
 
        else:
 
        else: # client always provides all the nonzero settings it wants
 
            prevClientSettings = {}
 
            
 
        prevClientSettings.update(self.resolvedSettingsDict(settings))
 
        self.lastRequest[client] = (clientSession, now, prevClientSettings)
 

	
 
@@ -115,7 +120,9 @@ class Collector(object):
 
        self.flush(pendingOut)
 
        dt2 = 1000 * (time.time() - now)
 
        if dt1 > 10:
 
            print "slow setAttrs: %.1fms -> flush -> %.1fms" % (dt1, dt2)
 
            print "slow setAttrs: %.1fms -> flush -> %.1fms. lr %s da %s oa %s" % (
 
                dt1, dt2, len(self.lastRequest), len(deviceAttrs), len(outputAttrs)
 
            )
 

	
 
    def setAttr(self, device, outputAttr, value, pendingOut):
 
        output, index = self.outputMap[(device, outputAttr)]
0 comments (0 inline, 0 general)