From 8a05fb08cb9e983fdda7d238f6e5c5b8d352f74d Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 28 Aug 2020 11:29:54 +0100 Subject: [PATCH] Don't use request context for BeginTx until mattn/go-sqlite3#764 is fixed --- syncapi/storage/shared/syncserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go index 2ef740ca8..401bae33b 100644 --- a/syncapi/storage/shared/syncserver.go +++ b/syncapi/storage/shared/syncserver.go @@ -451,7 +451,7 @@ func (d *Database) addPDUDeltaToResponse( wantFullState bool, res *types.Response, ) (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 { return nil, err } @@ -635,7 +635,7 @@ func (d *Database) getResponseWithPDUsForCompleteSync( // 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, // 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 { return }