Move start up DB checks to main data store.

This commit is contained in:
Erik Johnston 2019-12-06 13:09:40 +00:00
parent d537be1ebd
commit 75f87450d8
2 changed files with 12 additions and 18 deletions

View file

@ -14,6 +14,7 @@
# limitations under the License.
from synapse.storage.database import Database
from synapse.storage.prepare_database import prepare_database
class DataStores(object):
@ -26,4 +27,10 @@ class DataStores(object):
# Note we pass in the main store here as workers use a different main
# store.
database = Database(hs)
# Check that db is correctly configured.
database.engine.check_database(db_conn.cursor())
prepare_database(db_conn, database.engine, config=hs.config)
self.main = main_store_class(database, db_conn, hs)