Don't use request context for BeginTx until mattn/go-sqlite3#764 is fixed

This commit is contained in:
Neil Alexander 2020-08-28 11:29:54 +01:00
parent b697306ed1
commit 8a05fb08cb
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -451,7 +451,7 @@ func (d *Database) addPDUDeltaToResponse(
wantFullState bool, wantFullState bool,
res *types.Response, res *types.Response,
) (joinedRoomIDs []string, err error) { ) (joinedRoomIDs []string, err error) {
txn, err := d.DB.BeginTx(ctx, &txReadOnlySnapshot) txn, err := d.DB.BeginTx(context.TODO(), &txReadOnlySnapshot) // TODO: check mattn/go-sqlite3#764
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -635,7 +635,7 @@ func (d *Database) getResponseWithPDUsForCompleteSync(
// a consistent view of the database throughout. This includes extracting the sync position. // a consistent view of the database throughout. This includes extracting the sync position.
// This does have the unfortunate side-effect that all the matrixy logic resides in this function, // This does have the unfortunate side-effect that all the matrixy logic resides in this function,
// but it's better to not hide the fact that this is being done in a transaction. // but it's better to not hide the fact that this is being done in a transaction.
txn, err := d.DB.BeginTx(ctx, &txReadOnlySnapshot) txn, err := d.DB.BeginTx(context.TODO(), &txReadOnlySnapshot) // TODO: check mattn/go-sqlite3#764
if err != nil { if err != nil {
return return
} }