Use monkeypatch to allow multithreaded prod flask

Without this tasks were blocking when other task were active (for
instance, any task with --wait). Using the moneypatch, these no longer
block.
This commit is contained in:
Joshua Boniface 2020-08-28 02:09:31 -04:00
parent 65b44f2955
commit 973c78b8e0
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@
import gevent.pywsgi
import pvcapid.flaskapi as pvc_api
from gevent import monkey
##########################################################
# Entrypoint
@ -30,6 +31,7 @@ if pvc_api.config['debug']:
# Run in Flask standard mode
pvc_api.app.run(pvc_api.config['listen_address'], pvc_api.config['listen_port'])
else:
monkey.patch_all()
if pvc_api.config['ssl_enabled']:
# Run the WSGI server with SSL
http_server = gevent.pywsgi.WSGIServer(