prprprus / PyMySQLPool

PyMySQL-based database connection pool.
MIT License
60 stars 21 forks source link

allow to reconnect, i experience dissconnect error multiple times #21

Open bokunodev opened 3 years ago

bokunodev commented 3 years ago

i experienced this alot pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during query') and i think this change will fix it.

https://github.com/prprprus/PyMySQLPool/blob/212110afaaa01f1d0d3faa8fe099ad19f48a8fbe/pymysqlpool/pool.py#L184

change to c.ping(reconnect=True)