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

Poke notifier on next reactor tick #829

Merged
merged 1 commit into from
Jun 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
UserID, RoomAlias, RoomStreamToken, StreamToken, get_domain_from_id
)
from synapse.util import unwrapFirstError
from synapse.util.async import concurrently_execute
from synapse.util.async import concurrently_execute, run_on_reactor
from synapse.util.caches.snapshot_cache import SnapshotCache
from synapse.util.logcontext import PreserveLoggingContext, preserve_fn
from synapse.util.logcontext import preserve_fn
from synapse.visibility import filter_events_for_client

from ._base import BaseHandler
Expand Down Expand Up @@ -908,13 +908,16 @@ def is_inviter_member_event(e):
"Failed to get destination from event %s", s.event_id
)

with PreserveLoggingContext():
# Don't block waiting on waking up all the listeners.
@defer.inlineCallbacks
def _notify():
yield run_on_reactor()
self.notifier.on_new_room_event(
event, event_stream_id, max_stream_id,
extra_users=extra_users
)

preserve_fn(_notify)()

# If invite, remove room_state from unsigned before sending.
event.unsigned.pop("invite_room_state", None)

Expand Down