diff options
author | Erik Johnston <erik@matrix.org> | 2017-03-17 15:47:51 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-03-17 15:50:01 +0000 |
commit | 61f471f7793e7cd24d4dde5afd34cea1e46df724 (patch) | |
tree | 031b3cab4e49966d2a7ddd3aefd02bcfb444a511 /synapse/app/synchrotron.py | |
parent | Merge pull request #2016 from matrix-org/rav/queue_pdus_during_join (diff) | |
download | synapse-61f471f7793e7cd24d4dde5afd34cea1e46df724.tar.xz |
Don't send the full event json over replication
Diffstat (limited to 'synapse/app/synchrotron.py')
-rw-r--r-- | synapse/app/synchrotron.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/app/synchrotron.py b/synapse/app/synchrotron.py index 449fac771b..c75b7c04cd 100644 --- a/synapse/app/synchrotron.py +++ b/synapse/app/synchrotron.py @@ -410,11 +410,16 @@ class SynchrotronServer(HomeServer): stream = result.get("events") if stream: max_position = stream["position"] + + event_map = yield store.get_events([row[1] for row in stream["rows"]]) + for row in stream["rows"]: position = row[0] - internal = json.loads(row[1]) - event_json = json.loads(row[2]) - event = FrozenEvent(event_json, internal_metadata_dict=internal) + event_id = row[1] + event = event_map.get(event_id, None) + if not event: + continue + extra_users = () if event.type == EventTypes.Member: extra_users = (event.state_key,) |