django长时间运行进程数据库连接
我有一个 Django 项目,它有一个长时间运行(~3 小时)的管理命令 在我的生产环境( apache mod_wsgi )中,当尝试更新数据库时,此过程失败,最后管道(32)损坏。
谢谢
i have a django project with a long running (~3hour) management command
in my production environment ( apache mod_wsgi ) this process fails with a broken pipe(32) at the end, when trying to update the database.
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
损坏的管道主要意味着传输通道中的一个套接字已关闭而没有通知另一个套接字,在您的情况下,我认为这意味着您建立的数据库连接已从数据库部分关闭,因此当您编写代码时尝试使用它,它会引发异常。
通常数据库连接有一个超时,“通常”您可以通过将其设置得更大来配置该超时来解决此类问题,请检查您的数据库文档以了解如何解决。
注意:您没有给我们太多细节,所以我只是想在这里做出假设。
希望这能有所帮助。
The broken pipe mostly mean that one socket in the canal of transmission has been closed without notifying the other one , in your case i think it mean that the database connection that you have establish was closed from the database part, so when you code try to use it, it raise the exception.
Usually the database connection has a time out which "usually" you can configure by making it more bigger to solve this kind of problem , check your database documentation to see how.
N.B: you don't give us much detail so i'm just trying to make assumption here.
Well hope this can help.