Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add type hints to state database #10823

Merged
merged 7 commits into from
Sep 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix calls to cursor.
clokep committed Sep 15, 2021
commit 8fd777c92256df93a8806ded02a4431d8ff0f8ef
4 changes: 2 additions & 2 deletions synapse/storage/databases/state/bg_updates.py
Original file line number Diff line number Diff line change
@@ -367,7 +367,7 @@ def reindex_txn(conn: LoggingDatabaseConnection) -> None:
# postgres insists on autocommit for the index
conn.set_session(autocommit=True)
try:
txn = conn.LoggingTransaction()
txn = conn.cursor()
txn.execute(
"CREATE INDEX CONCURRENTLY state_groups_state_type_idx"
" ON state_groups_state(state_group, type, state_key)"
@@ -376,7 +376,7 @@ def reindex_txn(conn: LoggingDatabaseConnection) -> None:
finally:
conn.set_session(autocommit=False)
else:
txn = conn.LoggingTransaction()
txn = conn.cursor()
txn.execute(
"CREATE INDEX state_groups_state_type_idx"
" ON state_groups_state(state_group, type, state_key)"