mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Transaction writer changes, move roomserver writers (#1285)
* Updated TransactionWriters, moved locks in roomserver, various other tweaks * Fix redaction deadlocks * Fix lint issue * Rename SQLiteTransactionWriter to ExclusiveTransactionWriter * Fix us not sending transactions through in latest events updater
This commit is contained in:
parent
775b04d776
commit
b24747b305
54 changed files with 432 additions and 434 deletions
22
internal/sqlutil/writer_dummy.go
Normal file
22
internal/sqlutil/writer_dummy.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package sqlutil
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
type DummyTransactionWriter struct {
|
||||
}
|
||||
|
||||
func NewDummyTransactionWriter() TransactionWriter {
|
||||
return &DummyTransactionWriter{}
|
||||
}
|
||||
|
||||
func (w *DummyTransactionWriter) Do(db *sql.DB, txn *sql.Tx, f func(txn *sql.Tx) error) error {
|
||||
if txn == nil {
|
||||
return WithTransaction(db, func(txn *sql.Tx) error {
|
||||
return f(txn)
|
||||
})
|
||||
} else {
|
||||
return f(txn)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue