summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-29 15:33:44 +0000
committerErik Johnston <erik@matrix.org>2016-01-29 15:33:44 +0000
commit13724569eccbd2431f46868099afd44128af19d3 (patch)
tree5df9accf28e611e6b5724dd53cb65751ec934410
parentMake /events always return a newer token, if one exists (diff)
downloadsynapse-13724569eccbd2431f46868099afd44128af19d3.tar.xz
Deal with None limit
Diffstat (limited to '')
-rw-r--r--synapse/notifier.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index acd4019a91..32bd16661d 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -376,10 +376,14 @@ class Notifier(object):
                     continue
                 if only_keys and name not in only_keys:
                     continue
+                if limit:
+                    new_limit = max(limit * 2, 10)
+                else:
+                    new_limit = 10
                 new_events, new_key = yield source.get_new_events(
                     user=user,
                     from_key=getattr(from_token, keyname),
-                    limit=max(limit * 2, 10),
+                    limit=new_limit,
                     is_guest=is_peeking,
                     room_ids=room_ids,
                 )