diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-03 07:09:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-03 07:09:33 -0400 |
commit | db5970ac6d7843e7bd7e50638e0d999ed8018e37 (patch) | |
tree | 089cad6b23beac12dd57f8b15fab92663f51ec58 /synapse/handlers | |
parent | Fix some comments and types in service notices (#7996) (diff) | |
download | synapse-db5970ac6d7843e7bd7e50638e0d999ed8018e37.tar.xz |
Convert ACME code to async/await. (#7989)
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/acme.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/synapse/handlers/acme.py b/synapse/handlers/acme.py index a2d7959abe..7666d3abcd 100644 --- a/synapse/handlers/acme.py +++ b/synapse/handlers/acme.py @@ -17,7 +17,6 @@ import logging import twisted import twisted.internet.error -from twisted.internet import defer from twisted.web import server, static from twisted.web.resource import Resource @@ -41,8 +40,7 @@ class AcmeHandler(object): self.reactor = hs.get_reactor() self._acme_domain = hs.config.acme_domain - @defer.inlineCallbacks - def start_listening(self): + async def start_listening(self): from synapse.handlers import acme_issuing_service # Configure logging for txacme, if you need to debug @@ -82,18 +80,17 @@ class AcmeHandler(object): self._issuer._registered = False try: - yield self._issuer._ensure_registered() + await self._issuer._ensure_registered() except Exception: logger.error(ACME_REGISTER_FAIL_ERROR) raise - @defer.inlineCallbacks - def provision_certificate(self): + async def provision_certificate(self): logger.warning("Reprovisioning %s", self._acme_domain) try: - yield self._issuer.issue_cert(self._acme_domain) + await self._issuer.issue_cert(self._acme_domain) except Exception: logger.exception("Fail!") raise |