Rollback transaction after getting events

This commit is contained in:
Till Faelligen 2023-10-27 14:12:30 +02:00
parent 2bd71ba714
commit d2a9b374e5
No known key found for this signature in database
GPG key ID: ACCDC9606D472758

View file

@ -44,7 +44,7 @@ func GetEvent(
rsAPI api.SyncRoomserverAPI,
) util.JSONResponse {
ctx := req.Context()
db, err := syncDB.NewDatabaseTransaction(ctx)
db, err := syncDB.NewDatabaseSnapshot(ctx)
logger := util.GetLogger(ctx).WithFields(logrus.Fields{
"event_id": eventID,
"room_id": rawRoomID,
@ -56,6 +56,7 @@ func GetEvent(
JSON: spec.InternalServerError{},
}
}
defer db.Rollback() // nolint: errcheck
roomID, err := spec.NewRoomID(rawRoomID)
if err != nil {