Remove update_first set from set_state

It is already handled correctly in .render() method
This commit is contained in:
ZyX 2013-04-02 17:37:03 +04:00
parent 66beaaaa9d
commit 992e6151eb
1 changed files with 2 additions and 5 deletions

View File

@ -144,7 +144,7 @@ class KwThreadedSegment(ThreadedSegment):
except KeyError:
# Allow only to forbid to compute missing values: in either user
# configuration or in subclasses.
update_state = self.compute_state(key) if update_first and self.update_first or self.run_once else None
update_state = self.compute_state(key) if ((update_first and self.update_first) or self.run_once) else None
with self.write_lock:
self.new_queries[key] = (monotonic(), update_state)
@ -173,12 +173,9 @@ class KwThreadedSegment(ThreadedSegment):
return update_value
def set_state(self, interval=None, update_first=True, **kwargs):
def set_state(self, interval=None, **kwargs):
self.set_interval(interval)
if self.update_first:
self.update_first = update_first
@staticmethod
def render_one(update_state, **kwargs):
return update_state