diff options
author | Mark Haines <mjark@negativecurvature.net> | 2016-06-06 16:52:27 +0100 |
---|---|---|
committer | Mark Haines <mjark@negativecurvature.net> | 2016-06-06 16:52:27 +0100 |
commit | b0932b34cb9c4c8da3b635fd96f980d433a7a236 (patch) | |
tree | 5c71050e75a0f007393418b488fd686c51417b99 | |
parent | Merge pull request #844 from matrix-org/markjh/yield_on_sleep (diff) | |
parent | Fix a KeyError in the synchrotron presence (diff) | |
download | synapse-b0932b34cb9c4c8da3b635fd96f980d433a7a236.tar.xz |
Merge pull request #845 from matrix-org/markjh/synchrotron_presence
Fix a KeyError in the synchrotron presence
-rw-r--r-- | synapse/app/synchrotron.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/app/synchrotron.py b/synapse/app/synchrotron.py index 7273055cc1..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 |