mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 09:56:05 -04:00
Shuffle operations so that locking upsert happens last in the txn. This ensures the lock is held for the least amount of time possible.
This commit is contained in:
parent
e4c4664d73
commit
2732be83d9
5 changed files with 59 additions and 59 deletions
|
@ -42,3 +42,6 @@ class PostgresEngine(object):
|
|||
|
||||
def is_connection_closed(self, conn):
|
||||
return bool(conn)
|
||||
|
||||
def lock_table(self, txn, table):
|
||||
txn.execute("LOCK TABLE %s in EXCLUSIVE MODE" % (table,))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue