mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
after some testing, introduce multithreading
This commit is contained in:
@@ -29,4 +29,4 @@ if __name__ == "__main__":
|
|||||||
if DEBUG:
|
if DEBUG:
|
||||||
app.run(debug=True, port=port)
|
app.run(debug=True, port=port)
|
||||||
else:
|
else:
|
||||||
serve(app, port=port, threads=1)
|
serve(app, port=port, threads=app.config["WAITRESS_THREADS"])
|
||||||
|
@@ -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
|
# 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["SECRET_KEY"] = os.urandom(32)
|
||||||
app.config['SESSION_PERMANENT'] = True
|
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"] = {
|
app.config["PONY"] = {
|
||||||
'provider': 'sqlite',
|
'provider': 'sqlite',
|
||||||
'filename': os.path.abspath('db.db3'),
|
'filename': os.path.abspath('db.db3'),
|
||||||
@@ -40,6 +42,7 @@ app.config["CACHE_TYPE"] = "simple"
|
|||||||
|
|
||||||
cache = Cache(app)
|
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 = {}
|
multiworlds = {}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user