Skip to content

Commit

Permalink
Fix possible "Database is locked" issue
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK committed Sep 26, 2022
1 parent 8d64c24 commit 3c41651
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions userapi/storage/shared/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
})
}
Expand Down

0 comments on commit 3c41651

Please sign in to comment.