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

Commit

Permalink
Fixup docstrings & txn names
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Jul 14, 2022
1 parent b1f11cc commit c59d717
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
12 changes: 10 additions & 2 deletions synapse/storage/databases/main/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,27 @@ def _get_oldest_unsent_txn(
)

async def get_appservice_last_pos(self) -> int:
"""
Get the last stream ordering position for the appservice process.
"""

return await self.db_pool.simple_select_one_onecol(
table="appservice_stream_position",
retcol="stream_ordering",
keyvalues={},
desc="get_appservice_last_pos_txn",
desc="get_appservice_last_pos",
)

async def set_appservice_last_pos(self, pos: int) -> None:
"""
Set the last stream ordering position for the appservice process.
"""

await self.db_pool.simple_update_one(
table="appservice_stream_position",
keyvalues={},
updatevalues={"stream_ordering": pos},
desc="set_appservice_last_pos_txn",
desc="set_appservice_last_pos",
)

async def get_type_stream_id_for_appservice(
Expand Down
10 changes: 6 additions & 4 deletions synapse/storage/databases/main/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,12 +1032,14 @@ async def get_all_new_events_stream(
from_id: the stream_ordering of the last event we processed
current_id: the stream_ordering of the most recently processed event
limit: the maximum number of events to return
get_prev_content: whether to fetch previous event content
Returns:
A tuple of (next_id, events), where `next_id` is the next value to
pass as `from_id` (it will either be the stream_ordering of the
last returned event, or, if fewer than `limit` events were found,
the `current_id`).
A tuple of (next_id, events, event_to_received_ts), where `next_id`
is the next value to pass as `from_id` (it will either be the
stream_ordering of the last returned event, or, if fewer than `limit`
events were found, the `current_id`). The `event_to_received_ts` is
a dictionary mapping event ID to the event `received_ts`.
"""

def get_all_new_events_stream_txn(
Expand Down

0 comments on commit c59d717

Please sign in to comment.