summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-15 11:26:00 +0100
committerErik Johnston <erik@matrix.org>2015-05-15 11:26:00 +0100
commit372d4c6d7b38f89fb79509cf432915d96bdc8164 (patch)
tree310ba7416a135f2a432b66c206b10b1ca5659bbb /synapse
parentCorrectly pass through params (diff)
downloadsynapse-372d4c6d7b38f89fb79509cf432915d96bdc8164.tar.xz
Srsly. Don't use closures. Baaaaaad
Diffstat (limited to 'synapse')
-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")