RAILS - How to automatically reconnect to pg db
Asked Answered
R

0

7

I am running my rails 4 application with Postgres db, sometime my db connection getting lost with the below exception

 PG::ConnectionBad: PQconsumeInput() server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

And the connection is resuming properly after I restart the application, is their anyway to automatically reconnect to active record connection?

Regalia answered 14/2, 2015 at 16:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.