|
if res.IdleDuration() > time.Second { |
|
err := cr.conn.Ping(ctx) |
|
if err != nil { |
|
res.Destroy() |
|
continue |
|
} |
|
} |
I see it was added for:
Efficiently check if a connection has been closed before writing.
This reduces the cases where the application doesn't know if a query
that does a INSERT/UPDATE/DELETE was actually sent to the server or
not.
Our use case is using pgx in read only proxies, so if this check is purely for INSERT/UPDATE/DELETE then it seems like we are doing extra pings that aren't needed.
Possibly more noticeable for us as we have many pools configured, so likely connections can go idle for > 1 second.
Perhaps some config driven way to disable it?
pgx/pgxpool/pool.go
Lines 510 to 516 in b301530
I see it was added for:
Our use case is using pgx in read only proxies, so if this check is purely for
INSERT/UPDATE/DELETEthen it seems like we are doing extra pings that aren't needed.Possibly more noticeable for us as we have many pools configured, so likely connections can go idle for > 1 second.
Perhaps some config driven way to disable it?