summary refs log tree commit diff
path: root/synapse/app/event_creator.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-08-22 11:35:55 +0100
committerGitHub <noreply@github.com>2018-08-22 11:35:55 +0100
commit764030cf632a21b857b52fb61fad04f3d23f22c0 (patch)
tree3d829ed43131171127616eaa332a3ef95632eabe /synapse/app/event_creator.py
parentMerge pull request #3673 from matrix-org/erikj/refactor_state_handler (diff)
parentRename WorkerProfileHandler to BaseProfileHandler (diff)
downloadsynapse-764030cf632a21b857b52fb61fad04f3d23f22c0.tar.xz
Merge pull request #3659 from matrix-org/erikj/split_profiles
Allow profile updates to happen on workers
Diffstat (limited to 'synapse/app/event_creator.py')
-rw-r--r--synapse/app/event_creator.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/app/event_creator.py b/synapse/app/event_creator.py
index 03d39968a8..a34c89fa99 100644
--- a/synapse/app/event_creator.py
+++ b/synapse/app/event_creator.py
@@ -45,6 +45,11 @@ from synapse.replication.slave.storage.registration import SlavedRegistrationSto
 from synapse.replication.slave.storage.room import RoomStore
 from synapse.replication.slave.storage.transactions import SlavedTransactionStore
 from synapse.replication.tcp.client import ReplicationClientHandler
+from synapse.rest.client.v1.profile import (
+    ProfileAvatarURLRestServlet,
+    ProfileDisplaynameRestServlet,
+    ProfileRestServlet,
+)
 from synapse.rest.client.v1.room import (
     JoinRoomAliasServlet,
     RoomMembershipRestServlet,
@@ -53,6 +58,7 @@ from synapse.rest.client.v1.room import (
 )
 from synapse.server import HomeServer
 from synapse.storage.engines import create_engine
+from synapse.storage.user_directory import UserDirectoryStore
 from synapse.util.httpresourcetree import create_resource_tree
 from synapse.util.logcontext import LoggingContext
 from synapse.util.manhole import manhole
@@ -62,6 +68,9 @@ logger = logging.getLogger("synapse.app.event_creator")
 
 
 class EventCreatorSlavedStore(
+    # FIXME(#3714): We need to add UserDirectoryStore as we write directly
+    # rather than going via the correct worker.
+    UserDirectoryStore,
     DirectoryStore,
     SlavedTransactionStore,
     SlavedProfileStore,
@@ -101,6 +110,9 @@ class EventCreatorServer(HomeServer):
                     RoomMembershipRestServlet(self).register(resource)
                     RoomStateEventRestServlet(self).register(resource)
                     JoinRoomAliasServlet(self).register(resource)
+                    ProfileAvatarURLRestServlet(self).register(resource)
+                    ProfileDisplaynameRestServlet(self).register(resource)
+                    ProfileRestServlet(self).register(resource)
                     resources.update({
                         "/_matrix/client/r0": resource,
                         "/_matrix/client/unstable": resource,