diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-02-03 16:25:41 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-02-03 16:29:30 +0000 |
commit | 814cc00cb96168479a5c462e9078f3b60901589d (patch) | |
tree | 4316758104b592f432743c64ef15f4dd66304d55 | |
parent | make FederationHandler.persist_events_and_notify async (diff) | |
download | synapse-814cc00cb96168479a5c462e9078f3b60901589d.tar.xz |
make FederationHandler._notify_persisted_event async
-rw-r--r-- | synapse/handlers/federation.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index ec010c1f9f..19cd55b8cf 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -2849,13 +2849,15 @@ class FederationHandler(BaseHandler): for event, _ in event_and_contexts: 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 event or not. Args: - event (FrozenEvent) - max_stream_id (int): The max_stream_id returned by persist_events + event: + max_stream_id: The max_stream_id returned by persist_events """ extra_users = [] @@ -2879,7 +2881,7 @@ class FederationHandler(BaseHandler): 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): """Called to clean up any data in DB for a given room, ready for the |