summary refs log tree commit diff
path: root/synapse/notifier.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-27 17:21:30 +0100
committerErik Johnston <erik@matrix.org>2014-08-27 17:21:48 +0100
commit410a74b0f3b1c32d2ffa85aa7fa5e372a3341b9b (patch)
treeddd1aaeafbd8ab75b20982f4dba963456917f12f /synapse/notifier.py
parentAdd python shebang line and chmod +x setup.py (diff)
downloadsynapse-410a74b0f3b1c32d2ffa85aa7fa5e372a3341b9b.tar.xz
If timeout=0, return immediately
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r--synapse/notifier.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index 1656717cd7..3d3fcdabdb 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -178,9 +178,13 @@ class Notifier(object):
         if timeout:
             reactor.callLater(timeout/1000, self._timeout_listener, listener)
 
-        self._register_with_keys(listener)
+            self._register_with_keys(listener)
+
         yield self._check_for_updates(listener)
 
+        if not timeout:
+            self._timeout_listener(listener)
+
         return
 
     def _timeout_listener(self, listener):