summary refs log tree commit diff
path: root/synapse/storage/util
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-03-15 17:01:43 +0000
committerMark Haines <mark.haines@matrix.org>2016-03-15 17:33:10 +0000
commitb6e8420aeed9921ba7d0fd4c8ebaf1b64d5f677c (patch)
tree5360a982edc822f7af10bcdbdb24435bb42d12cd /synapse/storage/util
parentMerge pull request #644 from matrix-org/markjh/parse_jsonIII (diff)
downloadsynapse-b6e8420aeed9921ba7d0fd4c8ebaf1b64d5f677c.tar.xz
Add replication stream for pushers
Diffstat (limited to 'synapse/storage/util')
-rw-r--r--synapse/storage/util/id_generators.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/storage/util/id_generators.py b/synapse/storage/util/id_generators.py
index 610ddad423..a02dfc7d58 100644
--- a/synapse/storage/util/id_generators.py
+++ b/synapse/storage/util/id_generators.py
@@ -49,9 +49,14 @@ class StreamIdGenerator(object):
         with stream_id_gen.get_next() as stream_id:
             # ... persist event ...
     """
-    def __init__(self, db_conn, table, column):
+    def __init__(self, db_conn, table, column, extra_tables=[]):
         self._lock = threading.Lock()
         self._current_max = _load_max_id(db_conn, table, column)
+        for table, column in extra_tables:
+            self._current_max = max(
+                self._current_max,
+                _load_max_id(db_conn, table, column)
+            )
         self._unfinished_ids = deque()
 
     def get_next(self):