summary refs log tree commit diff
path: root/synapse/storage/pusher.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-15 16:24:14 +0100
committerErik Johnston <erik@matrix.org>2015-04-15 16:24:14 +0100
commited26e4012bb68cbde33f020b2756efe2bc87455a (patch)
tree0aaf676c7387b65addea28f94fb42fdb4ffc77d9 /synapse/storage/pusher.py
parentMake LruCache thread safe, as its used for event cache (diff)
downloadsynapse-ed26e4012bb68cbde33f020b2756efe2bc87455a.tar.xz
pushers table requires a unique id.
Diffstat (limited to '')
-rw-r--r--synapse/storage/pusher.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/storage/pusher.py b/synapse/storage/pusher.py
index 000502b4ff..e4135ba922 100644
--- a/synapse/storage/pusher.py
+++ b/synapse/storage/pusher.py
@@ -99,6 +99,7 @@ class PusherStore(SQLBaseStore):
                    app_display_name, device_display_name,
                    pushkey, pushkey_ts, lang, data):
         try:
+            next_id = self._pushers_id_gen.get_next()
             yield self._simple_upsert(
                 PushersTable.table_name,
                 dict(
@@ -115,6 +116,9 @@ class PusherStore(SQLBaseStore):
                     lang=lang,
                     data=data
                 ),
+                insertion_values=dict(
+                    id=next_id,
+                ),
                 desc="add_pusher",
             )
         except Exception as e: