summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-28 16:39:18 +0000
committerErik Johnston <erik@matrix.org>2016-01-28 16:39:18 +0000
commit45cf827c8fe7163a51f1d0d7c9e2531da9b58c8d (patch)
tree450edc3be0468c2f302c04b0df8cae058d3f79e5 /synapse
parentCache tags and account data (diff)
downloadsynapse-45cf827c8fe7163a51f1d0d7c9e2531da9b58c8d.tar.xz
Change name and doc has_entity_changed
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/account_data.py2
-rw-r--r--synapse/storage/stream.py2
-rw-r--r--synapse/storage/tags.py2
-rw-r--r--synapse/util/caches/stream_change_cache.py4
4 files changed, 6 insertions, 4 deletions
diff --git a/synapse/storage/account_data.py b/synapse/storage/account_data.py
index 95294c3f6c..62e49e1c0e 100644
--- a/synapse/storage/account_data.py
+++ b/synapse/storage/account_data.py
@@ -128,7 +128,7 @@ class AccountDataStore(SQLBaseStore):
 
             return (global_account_data, account_data_by_room)
 
-        changed = self._account_data_stream_cache.get_entity_has_changed(
+        changed = self._account_data_stream_cache.has_entity_changed(
             user_id, int(stream_id)
         )
         if not changed:
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index c7d7893328..6e81d46c60 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -200,7 +200,7 @@ class StreamStore(SQLBaseStore):
             defer.returnValue(([], from_key))
 
         if from_id:
-            has_changed = yield self._events_stream_cache.get_entity_has_changed(
+            has_changed = yield self._events_stream_cache.has_entity_changed(
                 room_id, from_id
             )
 
diff --git a/synapse/storage/tags.py b/synapse/storage/tags.py
index 50af899192..75ce04092d 100644
--- a/synapse/storage/tags.py
+++ b/synapse/storage/tags.py
@@ -88,7 +88,7 @@ class TagsStore(SQLBaseStore):
             room_ids = [row[0] for row in txn.fetchall()]
             return room_ids
 
-        changed = self._tags_stream_cache.get_entity_has_changed(user_id, int(stream_id))
+        changed = self._tags_stream_cache.has_entity_changed(user_id, int(stream_id))
         if not changed:
             defer.returnValue({})
 
diff --git a/synapse/util/caches/stream_change_cache.py b/synapse/util/caches/stream_change_cache.py
index 33b37f7f29..3ca0e57780 100644
--- a/synapse/util/caches/stream_change_cache.py
+++ b/synapse/util/caches/stream_change_cache.py
@@ -40,7 +40,9 @@ class StreamChangeCache(object):
         self.name = name
         caches_by_name[self.name] = self._cache
 
-    def get_entity_has_changed(self, entity, stream_pos):
+    def has_entity_changed(self, entity, stream_pos):
+        """Returns True if the entity may have been updated since stream_pos
+        """
         assert type(stream_pos) is int
 
         if stream_pos <= self._earliest_known_stream_pos: