diff options
author | Erik Johnston <erik@matrix.org> | 2020-09-09 16:19:22 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2020-09-09 16:19:22 +0100 |
commit | dc9dcdbd59d4f839c7a96780f7464460fae27851 (patch) | |
tree | 1c86319735b99474bc6a3a37b5d694d8f03f372f /synapse/push/pusherpool.py | |
parent | Fixup pusher pool notifications (diff) | |
download | synapse-dc9dcdbd59d4f839c7a96780f7464460fae27851.tar.xz |
Revert "Fixup pusher pool notifications"
This reverts commit e7fd336a53a4ca489cdafc389b494d5477019dc0.
Diffstat (limited to 'synapse/push/pusherpool.py')
-rw-r--r-- | synapse/push/pusherpool.py | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py index fa8473bf8d..3c3262a88c 100644 --- a/synapse/push/pusherpool.py +++ b/synapse/push/pusherpool.py @@ -64,12 +64,6 @@ class PusherPool: self._pusher_shard_config = hs.config.push.pusher_shard_config self._instance_name = hs.get_instance_name() - # Record the last stream ID that we were poked about so we can get - # changes since then. We set this to the current max stream ID on - # startup as every individual pusher will have checked for changes on - # startup. - self._last_room_stream_id_seen = self.store.get_room_max_stream_ordering() - # map from user id to app_id:pushkey to pusher self.pushers = {} # type: Dict[str, Dict[str, Union[HttpPusher, EmailPusher]]] @@ -184,27 +178,20 @@ class PusherPool: ) await self.remove_pusher(p["app_id"], p["pushkey"], p["user_name"]) - async def on_new_notifications(self, max_stream_id): + async def on_new_notifications(self, min_stream_id, max_stream_id): if not self.pushers: # nothing to do here. return - if max_stream_id < self._last_room_stream_id_seen: - # Nothing to do - return - - prev_stream_id = self._last_room_stream_id_seen - self._last_room_stream_id_seen = max_stream_id - try: users_affected = await self.store.get_push_action_users_in_range( - prev_stream_id, max_stream_id + min_stream_id, max_stream_id ) for u in users_affected: if u in self.pushers: for p in self.pushers[u].values(): - p.on_new_notifications(max_stream_id) + p.on_new_notifications(min_stream_id, max_stream_id) except Exception: logger.exception("Exception in pusher on_new_notifications") |