0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-16 15:01:23 +01:00

Comment on why arbitrary comments

This commit is contained in:
Erik Johnston 2017-05-31 17:30:26 +01:00
parent 5dd1b2c525
commit f5cc22bdc6

View file

@ -210,7 +210,9 @@ class UserDirectoryStore(SQLBaseStore):
def get_current_state_deltas_txn(txn): def get_current_state_deltas_txn(txn):
# First we calculate the max stream id that will give us less than # 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 = """ sql = """
SELECT stream_id, count(*) SELECT stream_id, count(*)
FROM current_state_delta_stream FROM current_state_delta_stream
@ -225,7 +227,9 @@ class UserDirectoryStore(SQLBaseStore):
max_stream_id = prev_stream_id max_stream_id = prev_stream_id
for max_stream_id, count in txn: for max_stream_id, count in txn:
total += count total += count
if total > 50: if total > 100:
# We arbitarily limit to 100 entries to ensure we don't
# select toooo many.
break break
# Now actually get the deltas # Now actually get the deltas