summary refs log tree commit diff
path: root/synapse/handlers/events.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-27 17:16:24 +0000
committerErik Johnston <erik@matrix.org>2014-11-27 17:16:24 +0000
commit5e26f6f3ae12d343bd2e1ba9b1b27fc1f7991fde (patch)
tree288cb19c083b7bc8c7d6ca4b5eed2f8484421bbf /synapse/handlers/events.py
parentAdd a workaround for bug where some initial join events don't reference creat... (diff)
parentBump version and changelog (diff)
downloadsynapse-5e26f6f3ae12d343bd2e1ba9b1b27fc1f7991fde.tar.xz
Merge branch 'release-v0.5.3' of github.com:matrix-org/synapse v0.5.3
Diffstat (limited to 'synapse/handlers/events.py')
-rw-r--r--synapse/handlers/events.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/handlers/events.py b/synapse/handlers/events.py
index d59221a4fb..02202692d4 100644
--- a/synapse/handlers/events.py
+++ b/synapse/handlers/events.py
@@ -53,8 +53,12 @@ class EventStreamHandler(BaseHandler):
             if auth_user not in self._streams_per_user:
                 self._streams_per_user[auth_user] = 0
                 if auth_user in self._stop_timer_per_user:
-                    self.clock.cancel_call_later(
-                        self._stop_timer_per_user.pop(auth_user))
+                    try:
+                        self.clock.cancel_call_later(
+                            self._stop_timer_per_user.pop(auth_user)
+                        )
+                    except:
+                        logger.exception("Failed to cancel event timer")
                 else:
                     yield self.distributor.fire(
                         "started_user_eventstream", auth_user
@@ -95,10 +99,12 @@ class EventStreamHandler(BaseHandler):
                     logger.debug(
                         "_later stopped_user_eventstream %s", auth_user
                     )
+
+                    self._stop_timer_per_user.pop(auth_user, None)
+
                     yield self.distributor.fire(
                         "stopped_user_eventstream", auth_user
                     )
-                    del self._stop_timer_per_user[auth_user]
 
                 logger.debug("Scheduling _later: for %s", auth_user)
                 self._stop_timer_per_user[auth_user] = (