Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当连接到 SQLAlchemy 中的引擎时,您可以设置 pool_recycle 标志以防止 MySQL 在 8 小时后自动断开连接。有谁知道这个 pool_recycle 标志的单位是什么?是分钟、小时还是秒?我在文档中找不到
class sqlalchemy.pool.Pool(creator, recycle=-1, echo=None, use_threadlocal=False, logging_name=None, reset_on_return=True, listeners=None, events=None, _dispatch=None)
[剪辑]
recycle – 如果设置为非 -1,则连接回收之间的秒数,这意味着在结帐时,如果超过此超时,则连接将关闭并替换为新打开的连接。默认为 -1。
http://docs.sqlalchemy.org/en/rel_0_7/core/pooling.html