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

Commit

Permalink
More fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Dec 4, 2020
1 parent 55f03b9 commit 3e98fb7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def _persist_event_auth_chain_txn(
txn,
table="rooms",
column="room_id",
iterable={event.room_id for event in events},
iterable={event.room_id for event in events if event.is_state()},
keyvalues={},
retcols=("room_id", "has_auth_chain_index"),
)
Expand Down
5 changes: 0 additions & 5 deletions synapse/storage/persist_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,6 @@ async def _persist_events(
(event, context)
)

logger.info("Persisting event: %s", event)

for room_id, ev_ctx_rm in events_by_room.items():
latest_event_ids = await self.main_store.get_latest_event_ids_in_room(
room_id
Expand All @@ -403,9 +401,6 @@ async def _persist_events(
# No change in extremities, so no change in state
continue

logger.info("Old extrem: %s", latest_event_ids)
logger.info("New extrem: %s", new_latest_event_ids)

# there should always be at least one forward extremity.
# (except during the initial persistence of the send_join
# results, in which case there will be no existing
Expand Down
5 changes: 5 additions & 0 deletions synapse/util/iterutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def chunk_seq(iseq: ISeq, maxlen: int) -> Iterable[ISeq]:
def sorted_topologically(
nodes: Iterable[T], graph: Dict[T, Collection[T]],
) -> Generator[T, None, None]:
"""Given a set of nodes and a graph, yield the nodes in toplogical order.
For example `sorted_topologically([1, 2], {1: [2]})` will yield `2, 1`.
"""

degree_map = {node: 0 for node in nodes}
reverse_graph = {} # type: Dict[T, Set[T]]

Expand Down

0 comments on commit 3e98fb7

Please sign in to comment.