treeform / pg

Very simple PostgreSQL async api for nim.
MIT License
37 stars 9 forks source link

Reconnect automatically #2

Open FedericoCeratto opened 4 years ago

FedericoCeratto commented 4 years ago

Thanks for developing pg. The current implementation does not handle reconnecting to the database in case of timed out or broken connections. Any workaround?

Also see https://github.com/nim-lang/db_connector/issues/9

treeform commented 2 years ago

I have this lib running in production for 2 years now. I never had connections time out between servers in the same data center. I guess its a very rare event?

treeform commented 2 years ago

Maybe db_postgres does auto reconnect?

FedericoCeratto commented 2 years ago

@treeform it really depend on the reliability of the network and if the server is restarted. Yet, detecting stale connections and reconnecting is usually a basic requirement for database libraries.

hasanyasin commented 1 year ago

Disconnects can also be caused by the server dropping older clients.