@log_function on PresenceStream's get_new_events_for_user()

This commit is contained in:
Paul "LeoNerd" Evans 2014-12-03 19:48:14 +00:00
parent 52f1d3c886
commit f5d2514fc0

View file

@ -804,6 +804,7 @@ class PresenceEventSource(object):
)
@defer.inlineCallbacks
@log_function
def get_new_events_for_user(self, user, from_key, limit):
from_key = int(from_key)
@ -816,7 +817,8 @@ class PresenceEventSource(object):
# TODO(paul): use a DeferredList ? How to limit concurrency.
for observed_user in cachemap.keys():
cached = cachemap[observed_user]
if not (from_key < cached.serial):
if cached.serial <= from_key:
continue
if (yield self.is_visible(observer_user, observed_user)):