mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 13:53: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
|
return nil, "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = d.Writer.Do(d.DB, txn, func(txn *sql.Tx) error {
|
err = d.RedactionsTable.InsertRedaction(ctx, txn, tables.RedactionInfo{
|
||||||
return d.RedactionsTable.InsertRedaction(ctx, txn, tables.RedactionInfo{
|
Validated: false,
|
||||||
Validated: false,
|
RedactionEventID: event.EventID(),
|
||||||
RedactionEventID: event.EventID(),
|
RedactsEventID: event.Redacts(),
|
||||||
RedactsEventID: event.Redacts(),
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
|
|
@ -605,9 +603,7 @@ func (d *Database) handleRedactions(
|
||||||
redactedEvent.Event = redactedEvent.Redact()
|
redactedEvent.Event = redactedEvent.Redact()
|
||||||
}
|
}
|
||||||
// overwrite the eventJSON table
|
// overwrite the eventJSON table
|
||||||
err = d.Writer.Do(d.DB, txn, func(txn *sql.Tx) error {
|
err = d.EventJSONTable.InsertEventJSON(ctx, txn, redactedEvent.EventNID, redactedEvent.JSON())
|
||||||
return d.EventJSONTable.InsertEventJSON(ctx, txn, redactedEvent.EventNID, redactedEvent.JSON())
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue