summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-01-19 15:26:19 +0000
committerMark Haines <mark.haines@matrix.org>2015-01-19 15:26:19 +0000
commit3e85e52b3f0e9330f29ec3d0f572db7b122c88b0 (patch)
treec76b1a2c0ba99637188186f92972e7e4dbcd013d /synapse/app
parentFinish renaming "context" to "room_id" in federation codebase (diff)
downloadsynapse-3e85e52b3f0e9330f29ec3d0f572db7b122c88b0.tar.xz
Allow ':memory:' as the database path for sqlite3
Diffstat (limited to 'synapse/app')
-rwxr-xr-xsynapse/app/homeserver.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 43b5c26144..61ad53fbb2 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -247,7 +247,13 @@ def setup():
 
     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(
+            hs.get_db_pool().runWithConnection, prepare_database
+        )
 
     if config.manhole:
         f = twisted.manhole.telnet.ShellFactory()