summary refs log tree commit diff
path: root/synapse/handlers/acme.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-08-03 07:09:33 -0400
committerGitHub <noreply@github.com>2020-08-03 07:09:33 -0400
commitdb5970ac6d7843e7bd7e50638e0d999ed8018e37 (patch)
tree089cad6b23beac12dd57f8b15fab92663f51ec58 /synapse/handlers/acme.py
parentFix some comments and types in service notices (#7996) (diff)
downloadsynapse-db5970ac6d7843e7bd7e50638e0d999ed8018e37.tar.xz
Convert ACME code to async/await. (#7989)
Diffstat (limited to 'synapse/handlers/acme.py')
-rw-r--r--synapse/handlers/acme.py11
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