mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 22:22:46 +00:00
Transactional isolation for /sync
(#2745)
This should transactional snapshot isolation for `/sync` etc requests. For now we don't use repeatable read due to some odd test failures with invites.
This commit is contained in:
parent
8a82f10046
commit
6348486a13
37 changed files with 1759 additions and 1527 deletions
|
@ -367,7 +367,13 @@ func (s *currentRoomStateStatements) SelectEventsWithEventIDs(
|
|||
for start < len(eventIDs) {
|
||||
n := minOfInts(len(eventIDs)-start, 999)
|
||||
query := strings.Replace(selectEventsWithEventIDsSQL, "($1)", sqlutil.QueryVariadic(n), 1)
|
||||
rows, err := txn.QueryContext(ctx, query, iEventIDs[start:start+n]...)
|
||||
var rows *sql.Rows
|
||||
var err error
|
||||
if txn == nil {
|
||||
rows, err = s.db.QueryContext(ctx, query, iEventIDs[start:start+n]...)
|
||||
} else {
|
||||
rows, err = txn.QueryContext(ctx, query, iEventIDs[start:start+n]...)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue