mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Change name and doc has_entity_changed
This commit is contained in:
parent
00cb3eb24b
commit
45cf827c8f
@ -128,7 +128,7 @@ class AccountDataStore(SQLBaseStore):
|
|||||||
|
|
||||||
return (global_account_data, account_data_by_room)
|
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)
|
user_id, int(stream_id)
|
||||||
)
|
)
|
||||||
if not changed:
|
if not changed:
|
||||||
|
@ -200,7 +200,7 @@ class StreamStore(SQLBaseStore):
|
|||||||
defer.returnValue(([], from_key))
|
defer.returnValue(([], from_key))
|
||||||
|
|
||||||
if from_id:
|
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
|
room_id, from_id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class TagsStore(SQLBaseStore):
|
|||||||
room_ids = [row[0] for row in txn.fetchall()]
|
room_ids = [row[0] for row in txn.fetchall()]
|
||||||
return room_ids
|
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:
|
if not changed:
|
||||||
defer.returnValue({})
|
defer.returnValue({})
|
||||||
|
|
||||||
|
@ -40,7 +40,9 @@ class StreamChangeCache(object):
|
|||||||
self.name = name
|
self.name = name
|
||||||
caches_by_name[self.name] = self._cache
|
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
|
assert type(stream_pos) is int
|
||||||
|
|
||||||
if stream_pos <= self._earliest_known_stream_pos:
|
if stream_pos <= self._earliest_known_stream_pos:
|
||||||
|
Loading…
Reference in New Issue
Block a user