Don't error if deleting a non-existent pusher. (#9121)

This commit is contained in:
Patrick Cloke 2021-01-25 14:52:30 -05:00 committed by GitHub
parent 4a55d267ee
commit 5b857b77f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

1
changelog.d/9121.bugfix Normal file
View File

@ -0,0 +1 @@
Fix spurious errors in logs when deleting a non-existant pusher.

View File

@ -344,7 +344,9 @@ class PusherStore(PusherWorkerStore):
txn, self.get_if_user_has_pusher, (user_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, txn,
"pushers", "pushers",
{"app_id": app_id, "pushkey": pushkey, "user_name": user_id}, {"app_id": app_id, "pushkey": pushkey, "user_name": user_id},