revert: Gunicorn didn't help, back to Flask dev server
Deploy loadtest / validate (push) Waiting to run
Deploy loadtest / validate (push) Waiting to run
This commit is contained in:
+2
-26
@@ -4,7 +4,7 @@ from flask import Flask, render_template, request
|
|||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
VERSION = '1.0.8'
|
VERSION = '1.0.7'
|
||||||
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
@@ -48,28 +48,4 @@ def upload():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import gunicorn.app.base
|
app.run(host='0.0.0.0', port=5000, debug=False, threaded=True)
|
||||||
|
|
||||||
class StandaloneApp(gunicorn.app.base.BaseApplication):
|
|
||||||
def __init__(self, app, options=None):
|
|
||||||
self.application = app
|
|
||||||
self.options = options or {}
|
|
||||||
super().__init__()
|
|
||||||
|
|
||||||
def load_config(self):
|
|
||||||
for k, v in self.options.items():
|
|
||||||
self.cfg.set(k, v)
|
|
||||||
|
|
||||||
def load(self):
|
|
||||||
return self.application
|
|
||||||
|
|
||||||
StandaloneApp(app, {
|
|
||||||
'bind': '0.0.0.0:5000',
|
|
||||||
'workers': 2,
|
|
||||||
'timeout': 300,
|
|
||||||
'worker_class': 'sync',
|
|
||||||
'keepalive': 5,
|
|
||||||
'limit_request_field_size': 0,
|
|
||||||
'limit_request_line': 0,
|
|
||||||
'limit_request_fields': 0,
|
|
||||||
}).run()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user