summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2020-09-04 11:02:10 +0100
committerBrendan Abolivier <babolivier@matrix.org>2020-09-04 11:02:10 +0100
commitcc23d81a74caead82fa97bddd535b29bb9e1df56 (patch)
tree7013f8ae7aaac8867313ac9e86ac90f93abbbff8 /synapse/handlers/message.py
parentMerge branch 'develop' into matrix-org-hotfixes (diff)
parentRevert "Add experimental support for sharding event persister. (#8170)" (#8242) (diff)
downloadsynapse-cc23d81a74caead82fa97bddd535b29bb9e1df56.tar.xz
Merge branch 'develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py

index 0016af44be..b6f400e9c3 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py
@@ -376,8 +376,9 @@ class EventCreationHandler(object): self.notifier = hs.get_notifier() self.config = hs.config self.require_membership_for_aliases = hs.config.require_membership_for_aliases - self._events_shard_config = self.config.worker.events_shard_config - self._instance_name = hs.get_instance_name() + self._is_event_writer = ( + self.config.worker.writers.events == hs.get_instance_name() + ) self.room_invite_state_types = self.hs.config.room_invite_state_types @@ -905,10 +906,9 @@ class EventCreationHandler(object): try: # If we're a worker we need to hit out to the master. - writer_instance = self._events_shard_config.get_instance(event.room_id) - if writer_instance != self._instance_name: + if not self._is_event_writer: result = await self.send_event( - instance_name=writer_instance, + instance_name=self.config.worker.writers.events, event_id=event.event_id, store=self.store, requester=requester, @@ -976,9 +976,7 @@ class EventCreationHandler(object): This should only be run on the instance in charge of persisting events. """ - assert self._events_shard_config.should_handle( - self._instance_name, event.room_id - ) + assert self._is_event_writer if ratelimit: # We check if this is a room admin redacting an event so that we