elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
306 stars 113 forks source link

Add manual ping #67

Closed fishcakez closed 7 years ago

fishcakez commented 7 years ago

Required a bit more code than I would like because had connection process callback return but it is simple and clear, and most code is tests. Will work with mariaex and postgrex without changes there. For https://github.com/elixir-ecto/ecto/issues/1789.

fishcakez commented 7 years ago

Ah this will raise if the connection isn't connected. Will need to write a special checkout. This can be unreliable, well a :pang might be returned if the previous request timed out even if connection would be successful. Also need to think about what to do if inside a rolling back transaction.

josevalim commented 7 years ago

@fishcakez it is also supposedly OK to handle failures in a task and handling exits, no?