I have a rails 6 application with some worker processes. The app uses PostgreSQL as a DB. Sometimes the DB reboots (e.g. minor version upgrade) and workers lose their connection. I'd expect them to auto-reconnect but it doesn't happen.
I tried to use reconnect: true
flag in database.yml. The same story. I still receive PG::UnableToSend: no connection to the server
. The option is not even available in PostgresqlAdapter. I guess it's only the MySQL adapter option.
The workers are simple service classes I run with rails runner
What could be done? I believe the answer must be simple.