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

Commit 92a7a5d

Browse files
committed
Remove redundant get_current_events_token
This was an exact duplicate of `get_room_max_stream_ordering`, so let's get rid of it.
1 parent 28356c9 commit 92a7a5d

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

synapse/handlers/federation_event.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ async def persist_events_and_notify(
18381838
The stream ID after which all events have been persisted.
18391839
"""
18401840
if not event_and_contexts:
1841-
return self._store.get_current_events_token()
1841+
return self._store.get_room_max_stream_ordering()
18421842

18431843
instance = self._config.worker.events_shard_config.get_instance(room_id)
18441844
if instance != self._instance_name:

synapse/handlers/presence.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def run_persister() -> Awaitable[None]:
729729

730730
# Presence is best effort and quickly heals itself, so lets just always
731731
# stream from the current state when we restart.
732-
self._event_pos = self.store.get_current_events_token()
732+
self._event_pos = self.store.get_room_max_stream_ordering()
733733
self._event_processing = False
734734

735735
async def _on_shutdown(self) -> None:

synapse/storage/databases/main/events_worker.py

-4
Original file line numberDiff line numberDiff line change
@@ -1383,10 +1383,6 @@ async def get_room_complexity(self, room_id: str) -> Dict[str, float]:
13831383

13841384
return {"v1": complexity_v1}
13851385

1386-
def get_current_events_token(self) -> int:
1387-
"""The current maximum token that events have reached"""
1388-
return self._stream_id_gen.get_current_token()
1389-
13901386
async def get_all_new_forward_event_rows(
13911387
self, instance_name: str, last_id: int, current_id: int, limit: int
13921388
) -> List[Tuple[int, str, str, str, str, str, str, str, str]]:

0 commit comments

Comments
 (0)