summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-14 15:41:55 +0100
committerErik Johnston <erik@matrix.org>2015-05-14 15:41:55 +0100
commitef3d8754f51e38375dc8d5144d2224d5e86ce458 (patch)
treeeac9cbabaa0352ded32a2454bedaab26829ab6f2 /synapse
parentCount and loop (diff)
downloadsynapse-ef3d8754f51e38375dc8d5144d2224d5e86ce458.tar.xz
Call from right thread
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/events.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index a6b2e7677f..59af21a2ca 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -513,6 +513,7 @@ class EventsStore(SQLBaseStore):
                         self._event_fetch_list = []
 
                         if not event_list:
+                            self._event_fetch_ongoing -= 1
                             return
 
                     event_id_lists = zip(*event_list)[0]
@@ -527,7 +528,8 @@ class EventsStore(SQLBaseStore):
                     }
 
                     for ids, d in event_list:
-                        d.callback(
+                        reactor.callFromThread(
+                            d.callback,
                             [
                                 row_dict[i] for i in ids
                                 if i in row_dict