summary refs log tree commit diff
path: root/synapse/app/synchrotron.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-07 11:07:27 +0100
committerErik Johnston <erik@matrix.org>2016-06-07 11:07:27 +0100
commitdbd788c2621d3f6af3dfe1624f81858ea561fcc5 (patch)
tree99a1c75673f8dc629b1405a1a1ebf5caa3823468 /synapse/app/synchrotron.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/timings (diff)
parentFix AS retries, but with correct ordering (diff)
downloadsynapse-dbd788c2621d3f6af3dfe1624f81858ea561fcc5.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/timings github/erikj/timings erikj/timings
Diffstat (limited to 'synapse/app/synchrotron.py')
-rw-r--r--synapse/app/synchrotron.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/app/synchrotron.py b/synapse/app/synchrotron.py

index aa81e1c5da..5c552ffb29 100644 --- a/synapse/app/synchrotron.py +++ b/synapse/app/synchrotron.py
@@ -187,7 +187,10 @@ class SynchrotronPresence(object): yield self._send_syncing_users_now() def _end(): - if affect_presence: + # We check that the user_id is in user_to_num_current_syncs because + # user_to_num_current_syncs may have been cleared if we are + # shutting down. + if affect_presence and user_id in self.user_to_num_current_syncs: self.user_to_num_current_syncs[user_id] -= 1 @contextlib.contextmanager @@ -443,7 +446,7 @@ class SynchrotronServer(HomeServer): notify(result) except: logger.exception("Error replicating from %r", replication_url) - sleep(5) + yield sleep(5) def build_presence_handler(self): return SynchrotronPresence(self)