mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-12 14:46:37 -05:00
Retry on deadlock
This commit is contained in:
parent
0bfa78b39b
commit
49d6aa1394
3 changed files with 21 additions and 3 deletions
|
|
@ -40,3 +40,8 @@ class MariaEngine(object):
|
|||
)
|
||||
db_conn.commit()
|
||||
prepare_database(db_conn, self)
|
||||
|
||||
def is_deadlock(self, error):
|
||||
if isinstance(error, self.module.InternalError):
|
||||
return error.sqlstate == 40001 and error.errno == 1213
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -32,3 +32,6 @@ class Sqlite3Engine(object):
|
|||
def prepare_database(self, db_conn):
|
||||
prepare_sqlite3_database(db_conn)
|
||||
prepare_database(db_conn, self)
|
||||
|
||||
def is_deadlock(self, error):
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue