简体   繁体   中英

How to set db timeout in webpy?

How to set db timeout in webpy

And how you usually do when db timeout in webpy ?

Assuming you're talking about a MySQL DB...

Mysql connector has connection_timeout parameter [1].

And web.py's MySQL class[2] uses **keywords in his definition, maybe you could use 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

[2] - https://github.com/webpy/webpy/blob/master/web/db.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM