mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Merge Updater structs (#1069)
* Move Updater structs to shared and use it for postgres * Add constructors for NewXXXUpdater and a useTxns flag In sqlite, we set useTxns=false and comment why. * Handle nil txn * Handle nil in transaction * Missed one * Close the txn at the right time * Don't close the transaction as we reuse it between calls
This commit is contained in:
parent
02fe38e1f7
commit
a6f995eb45
8 changed files with 381 additions and 744 deletions
|
@ -311,6 +311,19 @@ func (d *Database) GetTransactionEventID(
|
|||
return eventID, err
|
||||
}
|
||||
|
||||
func (d *Database) MembershipUpdater(
|
||||
ctx context.Context, roomID, targetUserID string,
|
||||
targetLocal bool, roomVersion gomatrixserverlib.RoomVersion,
|
||||
) (types.MembershipUpdater, error) {
|
||||
return NewMembershipUpdater(ctx, d, roomID, targetUserID, targetLocal, roomVersion, true)
|
||||
}
|
||||
|
||||
func (d *Database) GetLatestEventsForUpdate(
|
||||
ctx context.Context, roomNID types.RoomNID,
|
||||
) (types.RoomRecentEventsUpdater, error) {
|
||||
return NewRoomRecentEventsUpdater(d, ctx, roomNID, true)
|
||||
}
|
||||
|
||||
func (d *Database) StoreEvent(
|
||||
ctx context.Context, event gomatrixserverlib.Event,
|
||||
txnAndSessionID *api.TransactionID, authEventNIDs []types.EventNID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue