diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-07-27 09:17:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-27 09:17:11 +0100 |
commit | 7041cd872b8f1105d58f8e8ac79ffd32c76a1994 (patch) | |
tree | 4736db867cfd029d8e7627edb971eccc926371bc /synapse/handlers/profile.py | |
parent | Merge remote-tracking branch 'upstream/develop' into send_sni_for_federation_... (diff) | |
parent | Merge pull request #3616 from matrix-org/travis/event_id_send_leave (diff) | |
download | synapse-7041cd872b8f1105d58f8e8ac79ffd32c76a1994.tar.xz |
Merge branch 'develop' into send_sni_for_federation_requests
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r-- | synapse/handlers/profile.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index 859f6d2b2e..cb5c6d587e 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -18,6 +18,7 @@ import logging from twisted.internet import defer from synapse.api.errors import AuthError, CodeMessageException, SynapseError +from synapse.metrics.background_process_metrics import run_as_background_process from synapse.types import UserID, get_domain_from_id from ._base import BaseHandler @@ -41,7 +42,7 @@ class ProfileHandler(BaseHandler): if hs.config.worker_app is None: self.clock.looping_call( - self._update_remote_profile_cache, self.PROFILE_UPDATE_MS, + self._start_update_remote_profile_cache, self.PROFILE_UPDATE_MS, ) @defer.inlineCallbacks @@ -254,6 +255,12 @@ class ProfileHandler(BaseHandler): room_id, str(e.message) ) + def _start_update_remote_profile_cache(self): + return run_as_background_process( + "Update remote profile", self._update_remote_profile_cache, + ) + + @defer.inlineCallbacks def _update_remote_profile_cache(self): """Called periodically to check profiles of remote users we haven't checked in a while. |