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

Remove delay when rotating event push actions #13211

Merged
merged 2 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/13211.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
More aggressively rotate push actions.
4 changes: 1 addition & 3 deletions synapse/storage/databases/main/event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def __init__(
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:
Expand Down Expand Up @@ -847,7 +846,6 @@ async def _rotate_notifs(self) -> None:
)
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()
Expand Down Expand Up @@ -1109,7 +1107,7 @@ def remove_old_push_actions_that_have_rotated_txn(
) -> 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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and this is just so that it's easier to mess about with via the manhole


txn.execute(
"""
Expand Down