summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-15 15:12:07 +0100
committerErik Johnston <erik@matrix.org>2016-09-15 15:12:07 +0100
commit955f34d23e03c30c5c85df542e3b9b8bf9970110 (patch)
tree26b8c438a4d76464a870d656ab319f7f4b204fd7 /synapse/storage
parentUse stream_change cache to make get_forward_extremeties_for_room cache more e... (diff)
downloadsynapse-955f34d23e03c30c5c85df542e3b9b8bf9970110.tar.xz
Change get_pos_of_last_change to return upper bound
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/event_federation.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index 97d0c26475..59b4cf1e53 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -347,9 +347,8 @@ class EventFederationStore(SQLBaseStore):
     def get_forward_extremeties_for_room(self, room_id, stream_ordering):
         # We want to make the cache more effective, so we clamp to the last
         # change before the given ordering.
-        last_change = self._events_stream_cache.get_pos_of_last_change(room_id)
-        if last_change:
-            stream_ordering = min(last_change, stream_ordering)
+        last_change = self._events_stream_cache.get_max_pos_of_last_change(room_id)
+        stream_ordering = min(last_change, stream_ordering)
 
         return self._get_forward_extremeties_for_room(room_id, stream_ordering)