aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/sqlite3/invites_table.go
diff options
context:
space:
mode:
Diffstat (limited to 'syncapi/storage/sqlite3/invites_table.go')
-rw-r--r--syncapi/storage/sqlite3/invites_table.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/syncapi/storage/sqlite3/invites_table.go b/syncapi/storage/sqlite3/invites_table.go
index 7da86683..1a36ad40 100644
--- a/syncapi/storage/sqlite3/invites_table.go
+++ b/syncapi/storage/sqlite3/invites_table.go
@@ -117,13 +117,14 @@ func (s *inviteEventsStatements) InsertInviteEvent(
}
func (s *inviteEventsStatements) DeleteInviteEvent(
- ctx context.Context, inviteEventID string,
+ ctx context.Context, txn *sql.Tx, inviteEventID string,
) (types.StreamPosition, error) {
- streamPos, err := s.streamIDStatements.nextStreamID(ctx, nil)
+ streamPos, err := s.streamIDStatements.nextStreamID(ctx, txn)
if err != nil {
return streamPos, err
}
- _, err = s.deleteInviteEventStmt.ExecContext(ctx, streamPos, inviteEventID)
+ stmt := sqlutil.TxStmt(txn, s.deleteInviteEventStmt)
+ _, err = stmt.ExecContext(ctx, streamPos, inviteEventID)
return streamPos, err
}