cherokee 不同步更新 django 进程代码
我使用 cherokee(1.0) 作为 Web 服务器和 django Web 框架(1.2.1)。
当我更新 django 文件(如views.py 或静态文件)时,Web 服务器似乎 不立即更新。我猜这是关于缓存的,所以我设置了过期“已于1970年过期”,但问题仍然存在。
我也尝试在管理网站中重新启动服务器,但仍然无法解决问题。
如何同步更新或者自己更新?
I use cherokee(1.0) as web server and django web framework(1.2.1).
When I update django files like views.py or static files, web server seems
not to update instantly. I guess it is about cache, so i set expiration "already expired on 1970", but the problem remains.
I also try to restart server in admin website, but still can't solve the problem.
how can it update synchronicly or can I update it by myself?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试终止所有 fcgi 进程。
ps -ef | grep fcgi|awk '{print $2}'|xargs sudo Kill -9
==================================== =
我询问了 cherokee 项目并得到以下回复:
评论 1,作者:hcarvalhoalves,昨天(30 小时前)
发生这种情况是因为该请求仍在由旧的 FastCGI 进程提供服务。代码更改后,您不必重新启动 Cherokee,而是重新启动 FastCGI 进程。为此,您可以启动 django 并传递 PID 文件参数(在 Sources 下配置):
./manage runfcgi ... pidfile=/var/run/django-fcgi.pid
然后,当您更改代码时,重新启动 fcgi 进程与:
kill -HUP `cat /var/run/django-fcgi.pid
在 Cherokee 上根本不是错误,因为它不接触任何 python 文件,只是通过 FCGI 提供服务。
Try to kill all fcgi processes.
ps -ef | grep fcgi|awk '{print $2}'|xargs sudo kill -9
===================================
I asked cherokee project and get response below:
Comment 1 by hcarvalhoalves, Yesterday (30 hours ago)
This happens because the request is still being served by an old FastCGI process. After code changes, you don't have to restart Cherokee, but instead restart the FastCGI process. For that, you can start django passing the PID file parameter (configure this under Sources):
./manage runfcgi ... pidfile=/var/run/django-fcgi.pid
Then later, when you change code, restart the fcgi process with:
kill -HUP `cat /var/run/django-fcgi.pid
Not a bug on Cherokee at all, as it doesn't touch any python files, just serves thru FCGI.
这是应该发生的事情。
代码更改后您需要重新启动服务器。
This is what is supposed to happen.
You will need to restart the server after code changes.