summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/events.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 143c24b10d..2c3e6d5a5c 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -529,20 +529,18 @@ class EventsStore(SQLBaseStore):
 
                 logger.debug("do_fetch got events: %r", row_dict.keys())
 
-                def fire(evs):
-                    for ids, d in evs:
+                def fire(lst, res):
+                    for ids, d in lst:
                         if not d.called:
                             try:
-                                d.callback(
-                                    [
-                                        row_dict[i]
-                                        for i in ids
-                                        if i in row_dict
-                                    ]
-                                )
+                                d.callback([
+                                    res[i]
+                                    for i in ids
+                                    if i in res
+                                ])
                             except:
                                 logger.exception("Failed to callback")
-                reactor.callFromThread(fire, event_list)
+                reactor.callFromThread(fire, event_list, row_dict)
             except Exception as e:
                 logger.exception("do_fetch")