Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Don't pull out full state when sending dummy events (#13310)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston authored Jul 18, 2022
1 parent 6785b0f commit cf5fa50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.d/13310.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce memory usage of sending dummy events.
8 changes: 1 addition & 7 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1849,13 +1849,8 @@ async def _send_dummy_event_for_room(self, room_id: str) -> bool:

# For each room we need to find a joined member we can use to send
# the dummy event with.
latest_event_ids = await self.store.get_prev_events_for_room(room_id)
members = await self.state.get_current_users_in_room(
room_id, latest_event_ids=latest_event_ids
)
members = await self.store.get_local_users_in_room(room_id)
for user_id in members:
if not self.hs.is_mine_id(user_id):
continue
requester = create_requester(user_id, authenticated_entity=self.server_name)
try:
event, context = await self.create_event(
Expand All @@ -1866,7 +1861,6 @@ async def _send_dummy_event_for_room(self, room_id: str) -> bool:
"room_id": room_id,
"sender": user_id,
},
prev_event_ids=latest_event_ids,
)

event.internal_metadata.proactively_send = False
Expand Down

0 comments on commit cf5fa50

Please sign in to comment.