mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-16 15:01:23 +01:00
Srsly. Don't use closures. Baaaaaad
This commit is contained in:
parent
575ec91d82
commit
372d4c6d7b
1 changed files with 8 additions and 10 deletions
|
@ -529,20 +529,18 @@ class EventsStore(SQLBaseStore):
|
||||||
|
|
||||||
logger.debug("do_fetch got events: %r", row_dict.keys())
|
logger.debug("do_fetch got events: %r", row_dict.keys())
|
||||||
|
|
||||||
def fire(evs):
|
def fire(lst, res):
|
||||||
for ids, d in evs:
|
for ids, d in lst:
|
||||||
if not d.called:
|
if not d.called:
|
||||||
try:
|
try:
|
||||||
d.callback(
|
d.callback([
|
||||||
[
|
res[i]
|
||||||
row_dict[i]
|
for i in ids
|
||||||
for i in ids
|
if i in res
|
||||||
if i in row_dict
|
])
|
||||||
]
|
|
||||||
)
|
|
||||||
except:
|
except:
|
||||||
logger.exception("Failed to callback")
|
logger.exception("Failed to callback")
|
||||||
reactor.callFromThread(fire, event_list)
|
reactor.callFromThread(fire, event_list, row_dict)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception("do_fetch")
|
logger.exception("do_fetch")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue