pythonflaskuwsgi

autoreload python without master in uwsgi + flask


I have a Flask server, and for several reasons I need to set master = false in my uwsgi configuration. But due to this, I'm not able to auto reload on file changes anymore.

This is my uwsgi ini

[uwsgi]
master = false
enable-threads = true
wsgi-file = /opt/merlin/main.py
callable = app
protocol = http
http-socket = localhost:5000
daemonize = /var/log/merlin/merlin-app.log
env = FLASK_ENV=development
py-autoreload = 1

The reason that I need to use master = false is that I'm importing pandas and google.cloud.bigquery, and this causes the errors:

uWSGI listen queue of socket "localhost:5000" (fd: 3) full !!! (2871782829/10922)

Not exactly sure about the issue. Exploring more I found that it's related to PIL probably that causes it to not run with master = true.

So, is there any way to run python auto reload in uwsgi with master = false?


Solution

  • To sum up the discussion in the comments: