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.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