0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-05-15 20:05:15 +02:00

Fix possible "Database is locked" issue

This commit is contained in:
Till Faelligen 2022-09-26 10:45:35 +02:00
parent 8d64c24b23
commit 3c416517b0
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -777,7 +777,7 @@ func (d *Database) GetPushers(
func (d *Database) RemovePusher(
ctx context.Context, appid, pushkey, localpart string,
) error {
return d.Writer.Do(nil, nil, func(txn *sql.Tx) error {
return d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error {
err := d.Pushers.DeletePusher(ctx, txn, appid, pushkey, localpart)
if err == sql.ErrNoRows {
return nil
@ -792,7 +792,7 @@ func (d *Database) RemovePusher(
func (d *Database) RemovePushers(
ctx context.Context, appid, pushkey string,
) error {
return d.Writer.Do(nil, nil, func(txn *sql.Tx) error {
return d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error {
return d.Pushers.DeletePushers(ctx, txn, appid, pushkey)
})
}