Move monkeypatch before all imports
This commit is contained in:
parent
890023cbfc
commit
adfe302f71
|
@ -20,18 +20,19 @@
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
from gevent import monkey
|
||||||
|
monkey.patch_all()
|
||||||
|
|
||||||
import gevent.pywsgi
|
import gevent.pywsgi
|
||||||
import pvcapid.flaskapi as pvc_api
|
import pvcapid.flaskapi as pvc_api
|
||||||
from gevent import monkey
|
|
||||||
|
|
||||||
##########################################################
|
##########################################################
|
||||||
# Entrypoint
|
# Entrypoint
|
||||||
##########################################################
|
##########################################################
|
||||||
if pvc_api.config['debug']:
|
if pvc_api.config['debug']:
|
||||||
# Run in Flask standard mode
|
# Run in Flask standard mode
|
||||||
pvc_api.app.run(pvc_api.config['listen_address'], pvc_api.config['listen_port'])
|
pvc_api.app.run(pvc_api.config['listen_address'], pvc_api.config['listen_port'], threaded=True)
|
||||||
else:
|
else:
|
||||||
monkey.patch_all()
|
|
||||||
if pvc_api.config['ssl_enabled']:
|
if pvc_api.config['ssl_enabled']:
|
||||||
# Run the WSGI server with SSL
|
# Run the WSGI server with SSL
|
||||||
http_server = gevent.pywsgi.WSGIServer(
|
http_server = gevent.pywsgi.WSGIServer(
|
||||||
|
|
Loading…
Reference in New Issue