diff options
author | Erik Johnston <erik@matrix.org> | 2015-05-14 14:27:58 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-05-14 14:27:58 +0100 |
commit | 7d6a1dae31c96379f29bc9e4191d2c02f1dad640 (patch) | |
tree | ee6f76adf0416a5445773422640a1d9a17ebf33f /synapse/storage | |
parent | Actually, we probably want to run this in a transaction (diff) | |
download | synapse-7d6a1dae31c96379f29bc9e4191d2c02f1dad640.tar.xz |
Jump out early
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/_base.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index e44821b5ec..1a76b22e4f 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -883,6 +883,12 @@ class SQLBaseStore(object): missing_events_ids = [e for e in event_ids if e not in event_map] + if not missing_events_ids: + defer.returnValue([ + event_map[e_id] for e_id in event_ids + if e_id in event_map and event_map[e_id] + ]) + def get_missing(txn): missing_events = unwrap_deferred(self._fetch_events( txn, |