From 5ef05c70c30ec06376c48f443c5722fbf5dd2aa0 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 17 Jun 2022 11:58:00 +0100 Subject: [PATCH] Rotate notifications more frequently (#13096) --- changelog.d/13096.misc | 1 + synapse/storage/databases/main/event_push_actions.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/13096.misc diff --git a/changelog.d/13096.misc b/changelog.d/13096.misc new file mode 100644 index 000000000..3bb51962e --- /dev/null +++ b/changelog.d/13096.misc @@ -0,0 +1 @@ +Reduce DB usage of `/sync` when a large number of unread messages have recently been sent in a room. diff --git a/synapse/storage/databases/main/event_push_actions.py b/synapse/storage/databases/main/event_push_actions.py index ae705889a..10a796238 100644 --- a/synapse/storage/databases/main/event_push_actions.py +++ b/synapse/storage/databases/main/event_push_actions.py @@ -148,7 +148,7 @@ class EventPushActionsWorkerStore(ReceiptsWorkerStore, EventsWorkerStore, SQLBas self._doing_notif_rotation = False if hs.config.worker.run_background_tasks: self._rotate_notif_loop = self._clock.looping_call( - self._rotate_notifs, 30 * 60 * 1000 + self._rotate_notifs, 30 * 1000 ) self.db_pool.updates.register_background_index_update(