diff options
author | Mark Haines <mjark@negativecurvature.net> | 2016-03-31 10:33:02 +0100 |
---|---|---|
committer | Mark Haines <mjark@negativecurvature.net> | 2016-03-31 10:33:02 +0100 |
commit | 2ec54260350b46c937527bd566b713cf3544f1d2 (patch) | |
tree | af8a64e92727c4829a64f2ede2203ecfa1ceff4e /synapse/storage | |
parent | Add replication streams for ex outliers and current state resets (diff) | |
download | synapse-2ec54260350b46c937527bd566b713cf3544f1d2.tar.xz |
Use a namedtuple rather than tuple unpacking
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/events.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py index 9725a3fed7..b7ad045e41 100644 --- a/synapse/storage/events.py +++ b/synapse/storage/events.py @@ -25,7 +25,7 @@ from synapse.api.constants import EventTypes from canonicaljson import encode_canonical_json from contextlib import contextmanager - +from collections import namedtuple import logging import math @@ -1193,9 +1193,16 @@ class EventsStore(SQLBaseStore): new_backfill_events = [] backward_ex_outliers = [] - return ( + return AllNewEventsResult( new_forward_events, new_backfill_events, forward_ex_outliers, backward_ex_outliers, state_resets, ) return self.runInteraction("get_all_new_events", get_all_new_events_txn) + + +AllNewEventsResult = namedtuple("AllNewEventsResult", [ + "new_forward_events", "new_backfill_events", + "forward_ex_outliers", "backward_ex_outliers", + "state_resets" +]) |