erleans / pgo

Erlang Postgres client and connection pool
Apache License 2.0
80 stars 16 forks source link

implement ping #12

Closed tsloughter closed 4 years ago

tsloughter commented 5 years ago

Currently the ping to check on connections is not being done and simply acts as a success. Implement a ping to the postgres server to verify the connection is working and reconnect if it is not.

benbro commented 4 years ago

Isn't it implemented here? https://github.com/erleans/pgo/blob/master/src/pgo_handler.erl#L81

tsloughter commented 4 years ago

Hm, I guess so :) https://github.com/erleans/pgo/commit/8daa4f97e36efe62a1bc77439250be0f996ecb2c

Weird that i would implement it 2 days later but forget to close this. Hopefully I'm not forgetting anything :)

Thanks!

benbro commented 4 years ago

Do you check somewhere for response or will the socket automatically detect the problem?

tsloughter commented 4 years ago

The connection process crashes if it doesn't return ok.

benbro commented 4 years ago

Thanks