summary refs log tree commit diff
path: root/contrib
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-07-30 08:01:33 -0400
committerGitHub <noreply@github.com>2020-07-30 08:01:33 -0400
commitc978f6c4515a631f289aedb1844d8579b9334aaa (patch)
tree105d4069557d4b78c9b983ebfd8581ffad69165d /contrib
parentConvert appservice to async. (#7973) (diff)
downloadsynapse-c978f6c4515a631f289aedb1844d8579b9334aaa.tar.xz
Convert federation client to async/await. (#7975)
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cmdclient/console.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/contrib/cmdclient/console.py b/contrib/cmdclient/console.py
index 77422f5e5d..dfc1d294dc 100755
--- a/contrib/cmdclient/console.py
+++ b/contrib/cmdclient/console.py
@@ -609,13 +609,15 @@ class SynapseCmd(cmd.Cmd):
 
     @defer.inlineCallbacks
     def _do_event_stream(self, timeout):
-        res = yield self.http_client.get_json(
-            self._url() + "/events",
-            {
-                "access_token": self._tok(),
-                "timeout": str(timeout),
-                "from": self.event_stream_token,
-            },
+        res = yield defer.ensureDeferred(
+            self.http_client.get_json(
+                self._url() + "/events",
+                {
+                    "access_token": self._tok(),
+                    "timeout": str(timeout),
+                    "from": self.event_stream_token,
+                },
+            )
         )
         print(json.dumps(res, indent=4))