summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-09-10 16:23:58 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-09-10 16:23:58 +0100
commit55397f634770f2b91cd4567e6b40507944144b67 (patch)
treea056b26298b5766cc4459c20e1bbc7c8150759b6 /synapse/app
parentMake sure not to open our TCP ports until /after/ the DB is nicely prepared r... (diff)
downloadsynapse-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-xsynapse/app/homeserver.py10
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()