summary refs log tree commit diff
path: root/synapse/storage/pusher.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-04-07 17:38:48 +0100
committerDavid Baker <dave@matrix.org>2016-04-07 17:38:48 +0100
commit4836864f5681fbcca34a4c40384a7c4c8309b4e2 (patch)
treeac961532424fc8424d6b540738a6f26c998f2ccb /synapse/storage/pusher.py
parentOnly pass in what we need (diff)
downloadsynapse-4836864f5681fbcca34a4c40384a7c4c8309b4e2.tar.xz
generate id in the main thread
Diffstat (limited to '')
-rw-r--r--synapse/storage/pusher.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/pusher.py b/synapse/storage/pusher.py
index f7886dd1bb..b314e3ab4f 100644
--- a/synapse/storage/pusher.py
+++ b/synapse/storage/pusher.py
@@ -124,9 +124,9 @@ class PusherStore(SQLBaseStore):
                    app_display_name, device_display_name,
                    pushkey, pushkey_ts, lang, data, last_stream_ordering,
                    profile_tag=""):
-        def f(txn):
-            txn.call_after(self.get_users_with_pushers_in_room.invalidate_all)
-            with self._pushers_id_gen.get_next() as stream_id:
+        with self._pushers_id_gen.get_next() as stream_id:
+            def f(txn):
+                txn.call_after(self.get_users_with_pushers_in_room.invalidate_all)
                 return self._simple_upsert_txn(
                     txn,
                     "pushers",