diff --git a/WebHost.py b/WebHost.py index 5ded8d05..e792ab45 100644 --- a/WebHost.py +++ b/WebHost.py @@ -29,4 +29,4 @@ if __name__ == "__main__": if DEBUG: app.run(debug=True, port=port) else: - serve(app, port=port, threads=1) + serve(app, port=port, threads=app.config["WAITRESS_THREADS"]) diff --git a/WebHost/__init__.py b/WebHost/__init__.py index f4b4e8d1..a5141f5b 100644 --- a/WebHost/__init__.py +++ b/WebHost/__init__.py @@ -31,6 +31,8 @@ app.config['MAX_CONTENT_LENGTH'] = 1 * 1024 * 1024 # 1 megabyte limit # if you want persistent sessions on your server, make sure you make this a constant in your config.yaml app.config["SECRET_KEY"] = os.urandom(32) app.config['SESSION_PERMANENT'] = True +app.config[ + "WAITRESS_THREADS"] = 10 # waitress uses one thread for I/O, these are for processing of views that then get sent app.config["PONY"] = { 'provider': 'sqlite', 'filename': os.path.abspath('db.db3'), @@ -40,6 +42,7 @@ app.config["CACHE_TYPE"] = "simple" cache = Cache(app) +# this local cache is risky business if app hosting is done with subprocesses as it will not sync. Waitress is fine though multiworlds = {}