From 973c78b8e0856a680c40d9fc918cdd56add80826 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 28 Aug 2020 02:09:31 -0400 Subject: [PATCH] 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. --- api-daemon/pvcapid/Daemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api-daemon/pvcapid/Daemon.py b/api-daemon/pvcapid/Daemon.py index c2d9a4e6..d50541fa 100755 --- a/api-daemon/pvcapid/Daemon.py +++ b/api-daemon/pvcapid/Daemon.py @@ -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(