summary refs log tree commit diff
path: root/synapse/storage/databases/main/schema
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-03-02 14:05:01 +0000
committerGitHub <noreply@github.com>2021-03-02 14:05:01 +0000
commit16108c579deb17964f3603c7253454b711e9ccd0 (patch)
tree72a639f0e1cccfbf888bd43a966f396179a980f8 /synapse/storage/databases/main/schema
parentAdd type hints to device and event report admin API (#9519) (diff)
downloadsynapse-16108c579deb17964f3603c7253454b711e9ccd0.tar.xz
Fix SQL delta file taking a long time to run (#9516)
Fixes #9504
Diffstat (limited to 'synapse/storage/databases/main/schema')
-rw-r--r--synapse/storage/databases/main/schema/delta/59/08delete_pushers_for_deactivated_accounts.sql9
1 files changed, 4 insertions, 5 deletions
diff --git a/synapse/storage/databases/main/schema/delta/59/08delete_pushers_for_deactivated_accounts.sql b/synapse/storage/databases/main/schema/delta/59/08delete_pushers_for_deactivated_accounts.sql
index 20ba4abca3..0ec6764150 100644
--- a/synapse/storage/databases/main/schema/delta/59/08delete_pushers_for_deactivated_accounts.sql
+++ b/synapse/storage/databases/main/schema/delta/59/08delete_pushers_for_deactivated_accounts.sql
@@ -14,8 +14,7 @@
  */
 
 
--- We may not have deleted all pushers for deactivated accounts. Do so now.
---
--- Note: We don't bother updating the `deleted_pushers` table as it's just use
--- to stop pushers on workers, and that will happen when they get next restarted.
-DELETE FROM pushers WHERE user_name IN (SELECT name FROM users WHERE deactivated = 1);
+-- We may not have deleted all pushers for deactivated accounts, so we set up a
+-- background job to delete them.
+INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
+  (5908, 'remove_deactivated_pushers', '{}');