mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-10 16:33:11 -06:00
Add some docstring for withTransaction
This commit is contained in:
parent
47a23e1a0c
commit
901fcec288
|
|
@ -165,6 +165,9 @@ func processInviteEvent(db RoomEventDatabase, ow OutputRoomEventWriter, input ap
|
|||
})
|
||||
}
|
||||
|
||||
// withTransaction runs a function inside a transaction.
|
||||
// Commits the transaction if the function succeeds.
|
||||
// Rollsback the transaction if the function fails or panics.
|
||||
func withTransaction(t types.Transaction, f func() error) (err error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue