diff options
author | David Baker <dave@matrix.org> | 2015-01-22 17:46:16 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2015-01-22 17:46:16 +0000 |
commit | 5c6189ea3eb36409c57cd269a8931dda8f30e6ec (patch) | |
tree | 6a6217c76e23359e2edcebd1020b4807f18b3073 /synapse/app | |
parent | Oops: second part of commit dc938606 (diff) | |
parent | Merge pull request #30 from matrix-org/client_api_restructure (diff) | |
download | synapse-5c6189ea3eb36409c57cd269a8931dda8f30e6ec.tar.xz |
Merge branch 'develop' into pushers
Conflicts: synapse/rest/__init__.py
Diffstat (limited to 'synapse/app')
-rwxr-xr-x | synapse/app/homeserver.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 3d85fda67b..6ebf1f0de0 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -26,8 +26,8 @@ from twisted.web.resource import Resource from twisted.web.static import File from twisted.web.server import Site from synapse.http.server import JsonResource, RootRedirect -from synapse.media.v0.content_repository import ContentRepoResource -from synapse.media.v1.media_repository import MediaRepositoryResource +from synapse.rest.media.v0.content_repository import ContentRepoResource +from synapse.rest.media.v1.media_repository import MediaRepositoryResource from synapse.http.server_key_resource import LocalKey from synapse.http.matrixfederationclient import MatrixFederationHttpClient from synapse.api.urls import ( @@ -241,13 +241,20 @@ def setup(): except UpgradeDatabaseException: sys.stderr.write( "\nFailed to upgrade database.\n" - "Have you checked for version specific instructions in UPGRADES.rst?\n" + "Have you checked for version specific instructions in" + " UPGRADES.rst?\n" ) sys.exit(1) logger.info("Database prepared in %s.", db_name) - hs.get_db_pool() + db_pool = hs.get_db_pool() + + if db_name == ":memory:": + # Memory databases will need to be setup each time they are opened. + reactor.callWhenRunning( + db_pool.runWithConnection, prepare_database + ) if config.manhole: f = twisted.manhole.telnet.ShellFactory() |