mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-29 08:18:27 +00:00
re-add txn to SelectPeeks
This commit is contained in:
parent
75b91ac9e5
commit
b6cc4417cc
3 changed files with 6 additions and 6 deletions
|
@ -675,7 +675,7 @@ func (d *Database) getResponseWithPDUsForCompleteSync(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add peeked rooms.
|
// Add peeked rooms.
|
||||||
peeks, err := d.Peeks.SelectPeeks(ctx, userID, deviceID)
|
peeks, err := d.Peeks.SelectPeeks(ctx, txn, userID, deviceID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1012,7 +1012,7 @@ func (d *Database) getStateDeltas(
|
||||||
|
|
||||||
// find out which rooms this user is peeking, if any.
|
// find out which rooms this user is peeking, if any.
|
||||||
// We do this before joins so any peeks get overwritten
|
// We do this before joins so any peeks get overwritten
|
||||||
peeks, err := d.Peeks.SelectPeeks(ctx, userID, device.ID)
|
peeks, err := d.Peeks.SelectPeeks(ctx, txn, userID, device.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -1122,7 +1122,7 @@ func (d *Database) getStateDeltasForFullStateSync(
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
peeks, err := d.Peeks.SelectPeeks(ctx, userID, device.ID)
|
peeks, err := d.Peeks.SelectPeeks(ctx, txn, userID, device.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,9 +136,9 @@ func (s *peekStatements) DeletePeeks(
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *peekStatements) SelectPeeks(
|
func (s *peekStatements) SelectPeeks(
|
||||||
ctx context.Context, userID, deviceID string,
|
ctx context.Context, txn *sql.Tx, userID, deviceID string,
|
||||||
) (peeks []types.Peek, err error) {
|
) (peeks []types.Peek, err error) {
|
||||||
rows, err := s.selectPeeksStmt.QueryContext(ctx, userID, deviceID)
|
rows, err := sqlutil.TxStmt(txn, s.selectPeeksStmt).QueryContext(ctx, userID, deviceID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ type Peeks interface {
|
||||||
InsertPeek(ctx context.Context, txn *sql.Tx, roomID, userID, deviceID string) (streamPos types.StreamPosition, err error)
|
InsertPeek(ctx context.Context, txn *sql.Tx, roomID, userID, deviceID string) (streamPos types.StreamPosition, err error)
|
||||||
DeletePeek(ctx context.Context, txn *sql.Tx, roomID, userID, deviceID string) (streamPos types.StreamPosition, err error)
|
DeletePeek(ctx context.Context, txn *sql.Tx, roomID, userID, deviceID string) (streamPos types.StreamPosition, err error)
|
||||||
DeletePeeks(ctx context.Context, txn *sql.Tx, roomID, userID string) (streamPos types.StreamPosition, err error)
|
DeletePeeks(ctx context.Context, txn *sql.Tx, roomID, userID string) (streamPos types.StreamPosition, err error)
|
||||||
SelectPeeks(ctxt context.Context, userID, deviceID string) (peeks []types.Peek, err error)
|
SelectPeeks(ctxt context.Context, txn *sql.Tx, userID, deviceID string) (peeks []types.Peek, err error)
|
||||||
SelectPeekingDevices(ctxt context.Context) (peekingDevices map[string][]types.PeekingDevice, err error)
|
SelectPeekingDevices(ctxt context.Context) (peekingDevices map[string][]types.PeekingDevice, err error)
|
||||||
MarkPeeksAsOld(ctxt context.Context, txn *sql.Tx, userID, deviceID string) (err error)
|
MarkPeeksAsOld(ctxt context.Context, txn *sql.Tx, userID, deviceID string) (err error)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue