mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-01 17:06:10 -04:00
Add logging on startup/shutdown (#8448)
This is so we can tell what is going on when things are taking a while to start up. The main change here is to ensure that transactions that are created during startup get correctly logged like normal transactions.
This commit is contained in:
parent
ec10bdd32b
commit
e3debf9682
25 changed files with 152 additions and 113 deletions
|
@ -1,6 +1,8 @@
|
|||
import logging
|
||||
from io import StringIO
|
||||
|
||||
from synapse.storage.engines import PostgresEngine
|
||||
from synapse.storage.prepare_database import execute_statements_from_stream
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -46,7 +48,4 @@ def run_create(cur, database_engine, *args, **kwargs):
|
|||
select_clause,
|
||||
)
|
||||
|
||||
if isinstance(database_engine, PostgresEngine):
|
||||
cur.execute(sql)
|
||||
else:
|
||||
cur.executescript(sql)
|
||||
execute_statements_from_stream(cur, StringIO(sql))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue