summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-04-06 13:11:21 +0100
committerErik Johnston <erik@matrix.org>2017-04-06 13:11:21 +0100
commitdbf87282d39b9ee503f07d68c99ccc1624fc6e17 (patch)
tree682806469a4fc7d43e0172f65b25569287606ccf /synapse
parentDon't immediately notify the master about users whose syncs have gone away (diff)
downloadsynapse-dbf87282d39b9ee503f07d68c99ccc1624fc6e17.tar.xz
Docs
Diffstat (limited to 'synapse')
-rw-r--r--synapse/app/synchrotron.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/app/synchrotron.py b/synapse/app/synchrotron.py
index a5dfbef8da..e0716a6226 100644
--- a/synapse/app/synchrotron.py
+++ b/synapse/app/synchrotron.py
@@ -137,9 +137,13 @@ class SynchrotronPresence(object):
     def mark_as_coming_online(self, user_id):
         """A user has started syncing. Send a UserSync to the master, unless they
         had recently stopped syncing.
+
+        Args:
+            user_id (str)
         """
         going_offline = self.users_going_offline.pop(user_id, None)
         if not going_offline:
+            # Safe to skip if we haven't yet told the master they were offline
             self.send_user_sync(user_id, True, self.clock.time_msec())
 
     def mark_as_going_offline(self, user_id):
@@ -147,6 +151,9 @@ class SynchrotronPresence(object):
         its likely they'll come back soon. This allows us to avoid sending
         a stopped syncing immediately followed by a started syncing notification
         to the master
+
+        Args:
+            user_id (str)
         """
         self.users_going_offline[user_id] = self.clock.time_msec()