summary refs log tree commit diff
path: root/synapse/storage/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-08-15 15:39:05 +0100
committerGitHub <noreply@github.com>2016-08-15 15:39:05 +0100
commit75299af4fcaecfacb7449ebe0982d2ed0bd6edbd (patch)
tree65f878a58ae489aa0708f5ba66882f5c85f73003 /synapse/storage/__init__.py
parentMerge pull request #1007 from sargon/develop (diff)
parentDoc get_next() context manager usage (diff)
downloadsynapse-75299af4fcaecfacb7449ebe0982d2ed0bd6edbd.tar.xz
Merge pull request #1009 from matrix-org/erikj/event_split
Split out /events to synchrotron
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r--synapse/storage/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 73fb334dd6..7efc5bfeef 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -50,6 +50,7 @@ from .openid import OpenIdStore
 from .client_ips import ClientIpStore
 
 from .util.id_generators import IdGenerator, StreamIdGenerator, ChainedIdGenerator
+from .engines import PostgresEngine
 
 from synapse.api.constants import PresenceState
 from synapse.util.caches.stream_change_cache import StreamChangeCache
@@ -123,6 +124,13 @@ class DataStore(RoomMemberStore, RoomStore,
             extra_tables=[("deleted_pushers", "stream_id")],
         )
 
+        if isinstance(self.database_engine, PostgresEngine):
+            self._cache_id_gen = StreamIdGenerator(
+                db_conn, "cache_invalidation_stream", "stream_id",
+            )
+        else:
+            self._cache_id_gen = None
+
         events_max = self._stream_id_gen.get_current_token()
         event_cache_prefill, min_event_val = self._get_cache_dict(
             db_conn, "events",