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

Commit cf5fa50

Browse files
authored
Don't pull out full state when sending dummy events (#13310)
1 parent 6785b0f commit cf5fa50

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

changelog.d/13310.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reduce memory usage of sending dummy events.

synapse/handlers/message.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,13 +1849,8 @@ async def _send_dummy_event_for_room(self, room_id: str) -> bool:
18491849

18501850
# For each room we need to find a joined member we can use to send
18511851
# the dummy event with.
1852-
latest_event_ids = await self.store.get_prev_events_for_room(room_id)
1853-
members = await self.state.get_current_users_in_room(
1854-
room_id, latest_event_ids=latest_event_ids
1855-
)
1852+
members = await self.store.get_local_users_in_room(room_id)
18561853
for user_id in members:
1857-
if not self.hs.is_mine_id(user_id):
1858-
continue
18591854
requester = create_requester(user_id, authenticated_entity=self.server_name)
18601855
try:
18611856
event, context = await self.create_event(
@@ -1866,7 +1861,6 @@ async def _send_dummy_event_for_room(self, room_id: str) -> bool:
18661861
"room_id": room_id,
18671862
"sender": user_id,
18681863
},
1869-
prev_event_ids=latest_event_ids,
18701864
)
18711865

18721866
event.internal_metadata.proactively_send = False

0 commit comments

Comments
 (0)