mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-25 13:11:37 +00:00
Fix possible "Database is locked" issue
This commit is contained in:
parent
8d64c24b23
commit
3c416517b0
@ -777,7 +777,7 @@ func (d *Database) GetPushers(
|
|||||||
func (d *Database) RemovePusher(
|
func (d *Database) RemovePusher(
|
||||||
ctx context.Context, appid, pushkey, localpart string,
|
ctx context.Context, appid, pushkey, localpart string,
|
||||||
) error {
|
) 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)
|
err := d.Pushers.DeletePusher(ctx, txn, appid, pushkey, localpart)
|
||||||
if err == sql.ErrNoRows {
|
if err == sql.ErrNoRows {
|
||||||
return nil
|
return nil
|
||||||
@ -792,7 +792,7 @@ func (d *Database) RemovePusher(
|
|||||||
func (d *Database) RemovePushers(
|
func (d *Database) RemovePushers(
|
||||||
ctx context.Context, appid, pushkey string,
|
ctx context.Context, appid, pushkey string,
|
||||||
) error {
|
) 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)
|
return d.Pushers.DeletePushers(ctx, txn, appid, pushkey)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user