From 8da22e2b53614aa42776f9709a4265320e240765 Mon Sep 17 00:00:00 2001 From: Amber Brown Date: Mon, 11 Mar 2019 21:13:35 +1100 Subject: [PATCH] master startup --- synapse/app/homeserver.py | 1 + synapse/server.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index e8b6cc311..e0431608e 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -376,6 +376,7 @@ def setup(config_options): logger.info("Database prepared in %s.", config.database_config['name']) hs.setup() + hs.setup_master() @defer.inlineCallbacks def do_acme(): diff --git a/synapse/server.py b/synapse/server.py index 72835e8c8..c992bbaa5 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -185,6 +185,10 @@ class HomeServer(object): 'registration_handler', ] + REQUIRED_ON_MASTER_STARTUP = [ + "user_directory_handler", + ] + # This is overridden in derived application classes # (such as synapse.app.homeserver.SynapseHomeServer) and gives the class to be # instantiated during setup() for future return by get_datastore() @@ -221,6 +225,10 @@ class HomeServer(object): conn.commit() logger.info("Finished setting up.") + def setup_master(self): + for i in self.REQUIRED_ON_MASTER_STARTUP: + getattr(self, "get_" + i)() + def get_reactor(self): """ Fetch the Twisted reactor in use by this HomeServer.