summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-05-31 17:30:26 +0100
committerErik Johnston <erik@matrix.org>2017-05-31 17:30:26 +0100
commitf5cc22bdc63e58857f435227b70d145d07aabb77 (patch)
treef753970d814217e1e7eb3c85b6ffdf745bd09e02 /synapse
parentUse unique indices (diff)
downloadsynapse-f5cc22bdc63e58857f435227b70d145d07aabb77.tar.xz
Comment on why arbitrary comments
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/user_directory.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/storage/user_directory.py b/synapse/storage/user_directory.py
index 71b0502646..2e9175f50a 100644
--- a/synapse/storage/user_directory.py
+++ b/synapse/storage/user_directory.py
@@ -210,7 +210,9 @@ class UserDirectoryStore(SQLBaseStore):
 
         def get_current_state_deltas_txn(txn):
             # First we calculate the max stream id that will give us less than
-            # N results
+            # N results.
+            # We arbitarily limit to 100 stream_id entries to ensure we don't
+            # select toooo many.
             sql = """
                 SELECT stream_id, count(*)
                 FROM current_state_delta_stream
@@ -225,7 +227,9 @@ class UserDirectoryStore(SQLBaseStore):
             max_stream_id = prev_stream_id
             for max_stream_id, count in txn:
                 total += count
-                if total > 50:
+                if total > 100:
+                    # We arbitarily limit to 100 entries to ensure we don't
+                    # select toooo many.
                     break
 
             # Now actually get the deltas