Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
#!@PYTHON@
-import tornado.ioloop
+import asyncio
import tornado.options
tornado.options.define("debug", type=bool, default=False, help="Enable debug mode")
from ipfire.web import Application
-def run():
+async def run():
tornado.options.parse_command_line()
# Initialize application
debug=tornado.options.options.debug)
app.listen(tornado.options.options.port, xheaders=True)
- # Launch IOLoop
- tornado.ioloop.IOLoop.current().start()
+ # Wait for forever
+ await asyncio.Event().wait()
-run()
+# Wrap everything in an event loop
+asyncio.run(run())