summary refs log tree commit diff
path: root/synapse/storage/stream.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-29 16:52:48 +0000
committerErik Johnston <erik@matrix.org>2016-01-29 16:52:48 +0000
commit25c311eaf603cef8cbf9e6501aad83d53c304ebb (patch)
treeba17da62684427cc683c9ef6bb2bf5220d942239 /synapse/storage/stream.py
parentInvalidate _account_data_stream_cache correctly (diff)
downloadsynapse-25c311eaf603cef8cbf9e6501aad83d53c304ebb.tar.xz
Cache get_room_changes_for_user
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r--synapse/storage/stream.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index e245d2f914..cc9e623608 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -252,6 +252,13 @@ class StreamStore(SQLBaseStore):
         if from_key == to_key:
             return defer.succeed([])
 
+        if from_id:
+            has_changed = self._membership_stream_cache.has_entity_changed(
+                user_id, int(from_id)
+            )
+            if not has_changed:
+                return defer.succeed([])
+
         def f(txn):
             if from_id is not None:
                 sql = (