long2ice / asyncmy

A fast asyncio MySQL/MariaDB driver with replication protocol support
https://github.com/long2ice/asyncmy
Apache License 2.0
264 stars 32 forks source link

How to ping each connection in a pool? #23

Closed MarkReedZ closed 3 years ago

MarkReedZ commented 3 years ago

I'm getting connection lost errors even though I'm periodically calling ping. Is there a correct way to ping all connections in the pool to keep them open? If I call this every minute we should loop through all connections in the pool and ping them right?

    async with pool.acquire() as conn:
      await conn.ping(True)
long2ice commented 3 years ago

Why connection lost?