- Joined
- Jun 15, 2015
- Messages
- 1
- Reaction score
- 0
Hi everybody !
We are currenlty working on a project with multiple openstreetmap postgresql databases installed and one api instance, i added a X-Venue header for requests to route to a specified correctly installed database.
I've updated ApplicationController to connect to the specified database, it works but when i connect to a non existing database, it returns database not found even if the database is correct on future calls
Here is the code : https://gist.github.com/franckt/7c6a8cf5f0d7deffb9be
I'm not sure how rails works with pgsql, when the first connection occurs, and if establish_connection() is the good way, it seems that some connection polling somewhere keeps latest bad connection.
If i restart the server (bundle exec rails server) it works again
Is it because Rails doesn't close connections by default ?
Any help on that ?
(original issue was posted on openstreetmap/openstreetmap-website#980 but it's a rails issue in fact)
We are currenlty working on a project with multiple openstreetmap postgresql databases installed and one api instance, i added a X-Venue header for requests to route to a specified correctly installed database.
I've updated ApplicationController to connect to the specified database, it works but when i connect to a non existing database, it returns database not found even if the database is correct on future calls
Here is the code : https://gist.github.com/franckt/7c6a8cf5f0d7deffb9be
I'm not sure how rails works with pgsql, when the first connection occurs, and if establish_connection() is the good way, it seems that some connection polling somewhere keeps latest bad connection.
If i restart the server (bundle exec rails server) it works again
Is it because Rails doesn't close connections by default ?
Any help on that ?
(original issue was posted on openstreetmap/openstreetmap-website#980 but it's a rails issue in fact)