diff options
author | Erik Johnston <erik@matrix.org> | 2016-08-15 11:16:45 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-08-15 11:16:45 +0100 |
commit | 64e7e1185392972fd85718bfa55248b041f56b82 (patch) | |
tree | b41fae09aaaa891ede5c06ecc84db633403e4985 /synapse/storage/__init__.py | |
parent | Add some invalidations to a cache_stream (diff) | |
download | synapse-64e7e1185392972fd85718bfa55248b041f56b82.tar.xz |
Implement cache replication stream
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r-- | synapse/storage/__init__.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py index a0c029a2fc..8af492b69f 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 @@ -122,9 +123,13 @@ class DataStore(RoomMemberStore, RoomStore, db_conn, "pushers", "id", extra_tables=[("deleted_pushers", "stream_id")], ) - self._cache_id_gen = StreamIdGenerator( - db_conn, "cache_stream", "stream_id", - ) + + if isinstance(self.database_engine, PostgresEngine): + self._cache_id_gen = StreamIdGenerator( + db_conn, "cache_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( |