diff options
author | Shay <hillerys@element.io> | 2022-10-05 10:12:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 10:12:48 -0700 |
commit | 7b7478e8b65cceb9e7362c6c1cb932b569a6f383 (patch) | |
tree | 46298955947645bfbc9a07ae47c1738037d903ef /synapse/replication | |
parent | Complement test image: capture logs from nginx (#14063) (diff) | |
download | synapse-7b7478e8b65cceb9e7362c6c1cb932b569a6f383.tar.xz |
Batch up notifications after event persistence (#14033)
Diffstat (limited to 'synapse/replication')
-rw-r--r-- | synapse/replication/tcp/client.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/synapse/replication/tcp/client.py b/synapse/replication/tcp/client.py index b2522f98ca..18252a2958 100644 --- a/synapse/replication/tcp/client.py +++ b/synapse/replication/tcp/client.py @@ -210,15 +210,16 @@ class ReplicationDataHandler: max_token = self.store.get_room_max_token() event_pos = PersistedEventPosition(instance_name, token) - await self.notifier.on_new_room_event_args( - event_pos=event_pos, - max_room_stream_token=max_token, - extra_users=extra_users, - room_id=row.data.room_id, - event_id=row.data.event_id, - event_type=row.data.type, - state_key=row.data.state_key, - membership=row.data.membership, + event_entry = self.notifier.create_pending_room_event_entry( + event_pos, + extra_users, + row.data.room_id, + row.data.type, + row.data.state_key, + row.data.membership, + ) + await self.notifier.notify_new_room_events( + [(event_entry, row.data.event_id)], max_token ) # If this event is a join, make a note of it so we have an accurate |