1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/__init__.py b/synapse/__init__.py
index fbfd506a43..a6623e2956 100644
--- a/synapse/__init__.py
+++ b/synapse/__init__.py
@@ -44,8 +44,15 @@ if strtobool(os.environ.get("SYNAPSE_ASYNC_IO_REACTOR", "0")):
from twisted.internet import asyncioreactor
+ if bool(os.environ.get("SYNAPSE_UVLOOP", False)):
+ import uvloop
+
+ uvloop.install()
+ print("Using uvloop")
+
asyncioreactor.install(asyncio.get_event_loop())
+
# Twisted and canonicaljson will fail to import when this file is executed to
# get the __version__ during a fresh install. That's OK and subsequent calls to
# actually start Synapse will import these libraries fine.
|