make FederationHandler._notify_persisted_event async

This commit is contained in:
Richard van der Hoff 2020-02-03 16:25:41 +00:00
parent 05299599b6
commit 814cc00cb9
1 changed files with 6 additions and 4 deletions

View File

@ -2849,13 +2849,15 @@ class FederationHandler(BaseHandler):
for event, _ in event_and_contexts: for event, _ in event_and_contexts:
await self._notify_persisted_event(event, max_stream_id) await self._notify_persisted_event(event, max_stream_id)
def _notify_persisted_event(self, event, max_stream_id): async def _notify_persisted_event(
self, event: EventBase, max_stream_id: int
) -> None:
"""Checks to see if notifier/pushers should be notified about the """Checks to see if notifier/pushers should be notified about the
event or not. event or not.
Args: Args:
event (FrozenEvent) event:
max_stream_id (int): The max_stream_id returned by persist_events max_stream_id: The max_stream_id returned by persist_events
""" """
extra_users = [] extra_users = []
@ -2879,7 +2881,7 @@ class FederationHandler(BaseHandler):
event, event_stream_id, max_stream_id, extra_users=extra_users event, event_stream_id, max_stream_id, extra_users=extra_users
) )
return self.pusher_pool.on_new_notifications(event_stream_id, max_stream_id) await self.pusher_pool.on_new_notifications(event_stream_id, max_stream_id)
def _clean_room_for_join(self, room_id): def _clean_room_for_join(self, room_id):
"""Called to clean up any data in DB for a given room, ready for the """Called to clean up any data in DB for a given room, ready for the