mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
Improve add_callback performance.
(imported from commit 4cea356ee6b0777bddfc996d7b8ee1b5fee391c6)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user