The default timeout for a MySQL connection in Peewee is 28800 seconds, or 8 hours. However, this can be configured using the connect_timeout
parameter when creating a new MySQL database connection, like so:
from peewee import MySQLDatabase
database = MySQLDatabase('my_database', user='user', password='password', host='localhost', port=3306, connect_timeout=60)
In this example, the timeout is set to 60 seconds.
Asked: 2023-06-23 04:06:57 +0000
Seen: 16 times
Last updated: Jun 23 '23