From 737312ca3dc7c643e5f10840a4a4826a58236045 Mon Sep 17 00:00:00 2001 From: Midorica Date: Fri, 7 Jul 2023 21:50:24 -0400 Subject: [PATCH] Threading support to main twisted reactor --- index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index e936f14..70f4658 100644 --- a/index.py +++ b/index.py @@ -11,7 +11,7 @@ from twisted.web import server, resource from twisted.internet import reactor, endpoints from twisted.web.http import Request from routes import Mapper - +from threading import Thread class HttpDispatcher(resource.Resource): def __init__(self, cfg: CoreConfig, config_dir: str): @@ -283,4 +283,4 @@ if __name__ == "__main__": server.Site(dispatcher) ) - reactor.run() # type: ignore + Thread(target=reactor.run, args=(False,)).start()