Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Don't error if deleting a non-existent pusher. (#9121)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored Jan 25, 2021
1 parent 4a55d26 commit 5b857b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/9121.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix spurious errors in logs when deleting a non-existant pusher.
4 changes: 3 additions & 1 deletion synapse/storage/databases/main/pusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ def delete_pusher_txn(txn, stream_id):
txn, self.get_if_user_has_pusher, (user_id,)
)

self.db_pool.simple_delete_one_txn(
# It is expected that there is exactly one pusher to delete, but
# if it isn't there (or there are multiple) delete them all.
self.db_pool.simple_delete_txn(
txn,
"pushers",
{"app_id": app_id, "pushkey": pushkey, "user_name": user_id},
Expand Down

0 comments on commit 5b857b7

Please sign in to comment.