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

Commit

Permalink
Merge together redundant calculations/logging
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed May 3, 2017
1 parent 2347efc commit ef86218
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,9 @@ def on_receive_pdu(self, origin, pdu, get_missing=True):
# Update the set of things we've seen after trying to
# fetch the missing stuff
have_seen = yield self.store.have_events(prevs)

seen = set(have_seen.iterkeys())
if prevs - seen:
logger.info(
"Still missing %d prev events for %s: %r...",
len(prevs - seen), pdu.event_id, list(prevs - seen)[:5]
)
else:

if not prevs - seen:
logger.info(
"Found all missing prev events for %s", pdu.event_id
)
Expand All @@ -193,8 +188,6 @@ def on_receive_pdu(self, origin, pdu, get_missing=True):
list(prevs - seen)[:5],
)

prevs = {e_id for e_id, _ in pdu.prev_events}
seen = set(have_seen.keys())
if prevs - seen:
logger.info(
"Still missing %d events for room %r: %r...",
Expand Down

0 comments on commit ef86218

Please sign in to comment.