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

Add some docstrings (and avoid a duplicate query) in push actions processing #13455

Merged
merged 11 commits into from
Aug 4, 2022
Prev Previous commit
Next Next commit
More comments.
  • Loading branch information
clokep committed Aug 4, 2022
commit 6a36b471a22ef5da889770a4e81183c8aaeb9559
6 changes: 3 additions & 3 deletions synapse/storage/databases/main/event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ def _rotate_notifs_before_txn(
Args:
txn: The database transaction.
old_rotate_stream_ordering: The previous maximum event stream ordering.
rotate_to_stream_ordering: The new maximum event stream ordering to summarise.
rotate_to_stream_ordering: The new maximum event stream ordering to summarize.
clokep marked this conversation as resolved.
Show resolved Hide resolved

Returns whether the archiving process has caught up or not.
"""
Expand Down Expand Up @@ -1109,7 +1109,7 @@ async def _remove_old_push_actions_that_have_rotated(
) -> None:
"""Clear out old push actions that have been summarized."""

# We want to clear out anything that older than a day that *has* already
# We want to clear out anything that is older than a day that *has* already
# been rotated.
rotated_upto_stream_ordering = await self.db_pool.simple_select_one_onecol(
table="event_push_summary_stream_ordering",
Expand All @@ -1133,7 +1133,7 @@ def remove_old_push_actions_that_have_rotated_txn(
SELECT stream_ordering FROM event_push_actions
WHERE stream_ordering <= ? AND highlight = 0
ORDER BY stream_ordering ASC LIMIT 1 OFFSET ?
""",
""",
(
max_stream_ordering_to_delete,
batch_size,
Expand Down