diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-07-25 11:54:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-25 11:54:33 +0100 |
commit | 1bfb5bed1d50f8e02e0baad63b94708ece78dacc (patch) | |
tree | 9624d14b6622584e27f9bd3ae84dfaf4dd8b7ab2 /synapse/groups/attestations.py | |
parent | Merge pull request #3597 from matrix-org/erikj/did_forget (diff) | |
parent | Fix unit tests (diff) | |
download | synapse-1bfb5bed1d50f8e02e0baad63b94708ece78dacc.tar.xz |
Merge pull request #3604 from matrix-org/rav/background_process_fixes
Wrap a number of things that run in the background
Diffstat (limited to 'synapse/groups/attestations.py')
-rw-r--r-- | synapse/groups/attestations.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/groups/attestations.py b/synapse/groups/attestations.py index 47452700a8..4216af0a27 100644 --- a/synapse/groups/attestations.py +++ b/synapse/groups/attestations.py @@ -43,6 +43,7 @@ from signedjson.sign import sign_json from twisted.internet import defer from synapse.api.errors import SynapseError +from synapse.metrics.background_process_metrics import run_as_background_process from synapse.types import get_domain_from_id from synapse.util.logcontext import run_in_background @@ -129,7 +130,7 @@ class GroupAttestionRenewer(object): self.attestations = hs.get_groups_attestation_signing() self._renew_attestations_loop = self.clock.looping_call( - self._renew_attestations, 30 * 60 * 1000, + self._start_renew_attestations, 30 * 60 * 1000, ) @defer.inlineCallbacks @@ -151,6 +152,9 @@ class GroupAttestionRenewer(object): defer.returnValue({}) + def _start_renew_attestations(self): + run_as_background_process("renew_attestations", self._renew_attestations) + @defer.inlineCallbacks def _renew_attestations(self): """Called periodically to check if we need to update any of our attestations |