mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
Fix redaction deadlocks
This commit is contained in:
parent
630d6bd9c5
commit
ef02d503bc
|
|
@ -571,12 +571,10 @@ func (d *Database) handleRedactions(
|
|||
return nil, "", nil
|
||||
}
|
||||
|
||||
err = d.Writer.Do(d.DB, txn, func(txn *sql.Tx) error {
|
||||
return d.RedactionsTable.InsertRedaction(ctx, txn, tables.RedactionInfo{
|
||||
Validated: false,
|
||||
RedactionEventID: event.EventID(),
|
||||
RedactsEventID: event.Redacts(),
|
||||
})
|
||||
err = d.RedactionsTable.InsertRedaction(ctx, txn, tables.RedactionInfo{
|
||||
Validated: false,
|
||||
RedactionEventID: event.EventID(),
|
||||
RedactsEventID: event.Redacts(),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
|
|
@ -605,9 +603,7 @@ func (d *Database) handleRedactions(
|
|||
redactedEvent.Event = redactedEvent.Redact()
|
||||
}
|
||||
// overwrite the eventJSON table
|
||||
err = d.Writer.Do(d.DB, txn, func(txn *sql.Tx) error {
|
||||
return d.EventJSONTable.InsertEventJSON(ctx, txn, redactedEvent.EventNID, redactedEvent.JSON())
|
||||
})
|
||||
err = d.EventJSONTable.InsertEventJSON(ctx, txn, redactedEvent.EventNID, redactedEvent.JSON())
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue