我运行我的烧瓶应用程序,它运行良好,但到应用程序停止时和我的uwsgi日志
probably another instance of uWsgi is running on the same address (127.0.0.1:9002).
bind(): Address already in use [core/socket.c line 764]
当我运行触摸touch_reload时,应用程序再次运行.
我在服务器上运行其他任何可能接受套接字的东西.
我的conf:
Nginx
server {
listen 80;
....
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9001;
}
....
}
server {
listen 80;
....
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9003;
}
....
}
uwsgi:
chdir = /var/www/../
module = wsgihandler
socket = 127.0.0.1:9003
wsgi-file = app/__init__.py
callable = app
master = true
chmod-socket = 664
uid = root
gid = root
processes = 4
socket-timeout = 180
post-buffering = 8192
max-requests = 1000
buffer-size = 32768
logto = /var/www/.../log/uwsgi.log
touch-reload = /var/www/.../touch_reload
解决方法:
我有同样的问题,但问题是在sqlalchemy,尝试添加这个:
@app.teardown_request
def shutdown_session(exception=None):
from extension import db
db.session.remove()
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。