mirror of https://github.com/zulip/zulip.git
Improve add_callback performance.
(imported from commit 4cea356ee6b0777bddfc996d7b8ee1b5fee391c6)
This commit is contained in:
parent
a53d4e8177
commit
7f6d085ab6
|
@ -53,8 +53,9 @@ class UserProfile(models.Model):
|
|||
def add_callback(self, cb, last_received):
|
||||
global callback_table
|
||||
|
||||
new_zephyrs = filter_by_subscriptions(
|
||||
Zephyr.objects.filter(id__gt=last_received), self.user)
|
||||
new_zephyrs = [um.message for um in
|
||||
UserMessage.objects.filter(user_profile=self,
|
||||
message__id__gt=last_received)]
|
||||
|
||||
if new_zephyrs:
|
||||
return cb(new_zephyrs)
|
||||
|
|
Loading…
Reference in New Issue