uWSGI/Pylons 的开发模式(重新加载新代码)
我有一个设置,这样 nginx 服务器将控制权传递给 uWsgi,它使用我的 xml 配置文件中的以下内容启动 pylons 应用程序:
<ini-paste>...</ini-paste>
一切都运行良好,我能够使用关联中的以下内容将其设置为调试模式ini 文件,例如:
debug = true
除调试模式外,仅打印出错误,并且不会在每次触摸文件时重新加载代码。如果我直接通过粘贴运行,我可以使用 --reload
选项,但是通过 uWsgi 会使事情变得复杂。
有谁知道如何告诉uWsgi告诉paste设置--reload
选项,或者直接在paste .ini文件中执行此操作?
I have a setup such that an nginx server passes control off to uWsgi, which launches a pylons app using the following in my xml configuration file:
<ini-paste>...</ini-paste>
Everything is working nicely, and I was able to set it to debug mode using the following in the associated ini file, like:
debug = true
Except debug mode only prints out errors, and doesn't reload the code everytime a file has been touched. If I was running directly through paste, I could use the --reload
option, but going through uWsgi complicates things.
Does anybody know of a way to tell uWsgi to tell paste to set the --reload
option, or to do this directly in the paste .ini file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用类似下面的代码来解决这个问题,在应用程序初始化时调用monitorFiles(...)方法,它监视文件,在看到更改时发送TERM信号。
我仍然更喜欢使用 Paster 的 --reload 参数的解决方案,因为我认为这个解决方案有错误:
I used something like the following code to solve this, the monitorFiles(...) method is called on application initialization, and it monitors the files, sending the TERM signal when it sees a change.
I'd still much prefer a solution using paster's --reload argument, as I imagine this solution has bugs:
使用0.9.7树中的信号框架
http://projects.unbit.it/uwsgi/wiki/ SignalFramework
自动重载的示例:
Use the signal framework in 0.9.7 tree
http://projects.unbit.it/uwsgi/wiki/SignalFramework
An example of auto-reloading: