diff options
author | Erik Johnston <erik@matrix.org> | 2019-12-06 11:56:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-06 11:56:59 +0000 |
commit | f3ea2f5a08dc9e92f0b88e54c7955758a5b8cd65 (patch) | |
tree | c74f635c4241533ed5cb9f921b3edd4ce397a0b5 /scripts-dev/update_database | |
parent | Replace /admin/v1/users_paginate endpoint with /admin/v2/users (#5925) (diff) | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/make_datab... (diff) | |
download | synapse-f3ea2f5a08dc9e92f0b88e54c7955758a5b8cd65.tar.xz |
Merge pull request #6469 from matrix-org/erikj/make_database_class
Create a Database class and move methods out of SQLBaseStore
Diffstat (limited to 'scripts-dev/update_database')
-rwxr-xr-x | scripts-dev/update_database | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/scripts-dev/update_database b/scripts-dev/update_database index 27a1ad1e7e..1776d202c5 100755 --- a/scripts-dev/update_database +++ b/scripts-dev/update_database @@ -58,10 +58,10 @@ if __name__ == "__main__": " on it." ) ) - parser.add_argument("-v", action='store_true') + parser.add_argument("-v", action="store_true") parser.add_argument( "--database-config", - type=argparse.FileType('r'), + type=argparse.FileType("r"), required=True, help="A database config file for either a SQLite3 database or a PostgreSQL one.", ) @@ -101,10 +101,7 @@ if __name__ == "__main__": # Instantiate and initialise the homeserver object. hs = MockHomeserver( - config, - database_engine, - db_conn, - db_config=config.database_config, + config, database_engine, db_conn, db_config=config.database_config, ) # setup instantiates the store within the homeserver object. hs.setup() @@ -112,13 +109,13 @@ if __name__ == "__main__": @defer.inlineCallbacks def run_background_updates(): - yield store.run_background_updates(sleep=False) + yield store.db.updates.run_background_updates(sleep=False) # Stop the reactor to exit the script once every background update is run. reactor.stop() # Apply all background updates on the database. - reactor.callWhenRunning(lambda: run_as_background_process( - "background_updates", run_background_updates - )) + reactor.callWhenRunning( + lambda: run_as_background_process("background_updates", run_background_updates) + ) reactor.run() |