diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-10-20 11:29:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 11:29:38 -0400 |
commit | 9e0f22874f7ec338895d85645e91db8674c383c0 (patch) | |
tree | 4ad1b3e695380b1232808018d22f1f42a0e2b9a4 /synapse/handlers/profile.py | |
parent | Update mypy to 0.790, and move dependencies to extras (#8583) (diff) | |
download | synapse-9e0f22874f7ec338895d85645e91db8674c383c0.tar.xz |
Consistently use wrap_as_background_task in more places (#8599)
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r-- | synapse/handlers/profile.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index b784938755..b78a12ad01 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -24,7 +24,7 @@ from synapse.api.errors import ( StoreError, SynapseError, ) -from synapse.metrics.background_process_metrics import run_as_background_process +from synapse.metrics.background_process_metrics import wrap_as_background_process from synapse.types import UserID, create_requester, get_domain_from_id from ._base import BaseHandler @@ -57,7 +57,7 @@ class ProfileHandler(BaseHandler): if hs.config.run_background_tasks: self.clock.looping_call( - self._start_update_remote_profile_cache, self.PROFILE_UPDATE_MS + self._update_remote_profile_cache, self.PROFILE_UPDATE_MS ) async def get_profile(self, user_id): @@ -370,11 +370,7 @@ class ProfileHandler(BaseHandler): raise SynapseError(403, "Profile isn't available", Codes.FORBIDDEN) raise - def _start_update_remote_profile_cache(self): - return run_as_background_process( - "Update remote profile", self._update_remote_profile_cache - ) - + @wrap_as_background_process("Update remote profile") async def _update_remote_profile_cache(self): """Called periodically to check profiles of remote users we haven't checked in a while. |