diff options
author | Erik Johnston <erikj@jki.re> | 2017-07-21 11:05:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-21 11:05:39 +0100 |
commit | 96917d555240f52c98d698f95e2ff1e65c8b0b5d (patch) | |
tree | df70bdc99fc2db0a229a42a55b1de2efda99e883 /synapse/storage/__init__.py | |
parent | Merge pull request #2377 from matrix-org/erikj/group_profile_update (diff) | |
parent | Add notifier (diff) | |
download | synapse-96917d555240f52c98d698f95e2ff1e65c8b0b5d.tar.xz |
Merge pull request #2378 from matrix-org/erikj/group_sync_support
Add groups to sync stream
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r-- | synapse/storage/__init__.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py index fdee9f1ad5..594566eb38 100644 --- a/synapse/storage/__init__.py +++ b/synapse/storage/__init__.py @@ -136,6 +136,9 @@ class DataStore(RoomMemberStore, RoomStore, db_conn, "pushers", "id", extra_tables=[("deleted_pushers", "stream_id")], ) + self._group_updates_id_gen = StreamIdGenerator( + db_conn, "local_group_updates", "stream_id", + ) if isinstance(self.database_engine, PostgresEngine): self._cache_id_gen = StreamIdGenerator( @@ -236,6 +239,18 @@ class DataStore(RoomMemberStore, RoomStore, prefilled_cache=curr_state_delta_prefill, ) + _group_updates_prefill, min_group_updates_id = self._get_cache_dict( + db_conn, "local_group_updates", + entity_column="user_id", + stream_column="stream_id", + max_value=self._group_updates_id_gen.get_current_token(), + limit=1000, + ) + self._group_updates_stream_cache = StreamChangeCache( + "_group_updates_stream_cache", min_group_updates_id, + prefilled_cache=_group_updates_prefill, + ) + cur = LoggingTransaction( db_conn.cursor(), name="_find_stream_orderings_for_times_txn", |