[英]How to set db timeout in webpy?
How to set db timeout in webpy 如何在Webpy中设置数据库超时
And how you usually do when db timeout in webpy ? 以及在webpy中数据库超时时通常如何做?
Assuming you're talking about a MySQL DB... 假设您正在谈论MySQL数据库...
Mysql connector has connection_timeout parameter [1]. Mysql连接器具有connection_timeout参数[1]。
And web.py's MySQL class[2] uses **keywords in his definition, maybe you could use connection_timeout. web.py的MySQL类[2]在其定义中使用了**关键字,也许您可以使用connection_timeout。
At least I've tried here and my connection works. 至少我在这里尝试过并且我的连接有效。 I've just couldn't wait to see if it drops when time expires.
我只是迫不及待地想看看时间到时它是否下降。
[1] - http://dev.mysql.com/doc/refman/5.7/en/connector-python-connectargs.html [1] -http://dev.mysql.com/doc/refman/5.7/en/connector-python-connectargs.html
[2] - https://github.com/webpy/webpy/blob/master/web/db.py [2] -https://github.com/webpy/webpy/blob/master/web/db.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.