Skip to content

Commit

Permalink
master startup
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkowl committed Mar 11, 2019
1 parent 30a8dee commit 8da22e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
8 changes: 8 additions & 0 deletions synapse/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ def build_DEPENDENCY(self)
'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()
Expand Down Expand Up @@ -221,6 +225,10 @@ def setup(self):
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.
Expand Down

0 comments on commit 8da22e2

Please sign in to comment.