RuntimeError: The scheduler seems to be running under uWSGI, but threads have been disabled. You must run uWSGI with the --enable-threads option for the scheduler to work报错

解释

RuntimeError: The scheduler seems to be running under uWSGI, but threads have been disabled. You must run uWSGI with the --enable-threads option for the scheduler to work,
白话:uWSGI调度器正在运行,但线程已被禁用

解决

uwsgi.ini里面添加:

http-timeout = 86400
enable-threads = true

总的uwsgi.ini配置如下:

[uwsgi]
#项目路径
chdir = /home/ubuntu/code/python/python_person/flask+vue2/flask-vue2
#虚拟环境环境路径
virtualenv = /home/ubuntu/code/python/python_person/flask+vue2/flask-vue2/.venv
#保存主进程的进程号
pidfile = uwsgi.pid
#指的后台启动 日志输出的地方
daemonize = uwsgi.log
http = 0.0.0.0:5000
#[方式一]wsgi文件 run就是flask启动文件去掉后缀名 app是run.py里面的Flask对象 
module = app:app
#指定工作进程
processes = 4
#主进程
master = true

# 当一个请求花费的时间超过这个时间,那么这个请求都会被丢弃。
harakiri = 60

# 新加
http-timeout = 86400
enable-threads = true

# 方式二
#wsgi-file = run.py
#callable = app

posted @ 2023-11-13 02:45  __username  阅读(79)  评论(0编辑  收藏  举报

本文作者:DIVMonster

本文链接:https://www.cnblogs.com/guangzan/p/12886111.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。