diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-10 16:23:58 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-10 16:23:58 +0100 |
commit | 55397f634770f2b91cd4567e6b40507944144b67 (patch) | |
tree | a056b26298b5766cc4459c20e1bbc7c8150759b6 /synapse/app | |
parent | Make sure not to open our TCP ports until /after/ the DB is nicely prepared r... (diff) | |
download | synapse-55397f634770f2b91cd4567e6b40507944144b67.tar.xz |
prepare_database() on db_conn, not plain name, so we can pass in the connection from outside
Diffstat (limited to 'synapse/app')
-rwxr-xr-x | synapse/app/homeserver.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index e6377e3060..2f1b954902 100755 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -39,6 +39,7 @@ import logging import os import re import sys +import sqlite3 logger = logging.getLogger(__name__) @@ -208,7 +209,14 @@ def setup(): redirect_root_to_web_client=True, ) - prepare_database(hs.get_db_name()) + db_name = hs.get_db_name() + + logging.info("Preparing database: %s...", db_name) + + with sqlite3.connect(db_name) as db_conn: + prepare_database(db_conn) + + logging.info("Database prepared in %s.", db_name) hs.get_db_pool() |