diff options
author | Erik Johnston <erik@matrix.org> | 2022-07-11 16:51:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 16:51:30 +0100 |
commit | f1711e1f5c40232b5749d9df23b9857b8c1eb661 (patch) | |
tree | 804b1fc791a1d0e8b4ec656178b68b93ec906025 | |
parent | Document the 'databases' homeserver config option (#13212) (diff) | |
download | synapse-f1711e1f5c40232b5749d9df23b9857b8c1eb661.tar.xz |
Remove delay when rotating event push actions (#13211)
We want to be as up to date as possible, and sleeping doesn't help here and can mean we fall behind.
-rw-r--r-- | changelog.d/13211.misc | 1 | ||||
-rw-r--r-- | synapse/storage/databases/main/event_push_actions.py | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/changelog.d/13211.misc b/changelog.d/13211.misc new file mode 100644 index 0000000000..4d2a6dec65 --- /dev/null +++ b/changelog.d/13211.misc @@ -0,0 +1 @@ +More aggressively rotate push actions. diff --git a/synapse/storage/databases/main/event_push_actions.py b/synapse/storage/databases/main/event_push_actions.py index 1a951ac02a..dd2627037c 100644 --- a/synapse/storage/databases/main/event_push_actions.py +++ b/synapse/storage/databases/main/event_push_actions.py @@ -143,7 +143,6 @@ class EventPushActionsWorkerStore(ReceiptsWorkerStore, StreamWorkerStore, SQLBas self._find_stream_orderings_for_times, 10 * 60 * 1000 ) - self._rotate_delay = 3 self._rotate_count = 10000 self._doing_notif_rotation = False if hs.config.worker.run_background_tasks: @@ -847,7 +846,6 @@ class EventPushActionsWorkerStore(ReceiptsWorkerStore, StreamWorkerStore, SQLBas ) if caught_up: break - await self.hs.get_clock().sleep(self._rotate_delay) # Finally we clear out old event push actions. await self._remove_old_push_actions_that_have_rotated() @@ -1114,7 +1112,7 @@ class EventPushActionsWorkerStore(ReceiptsWorkerStore, StreamWorkerStore, SQLBas ) -> bool: # We don't want to clear out too much at a time, so we bound our # deletes. - batch_size = 10000 + batch_size = self._rotate_count txn.execute( """ |