-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Establishes connection during application boot #607
Open
fsateler opened this issue
Jun 20, 2019
· 1 comment
· Fixed by rails-on-services/apartment#39 · May be fixed by #612
Open
Establishes connection during application boot #607
fsateler opened this issue
Jun 20, 2019
· 1 comment
· Fixed by rails-on-services/apartment#39 · May be fixed by #612
Comments
this is one of my bugbears too. |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Boot an application with
bin/rails r "puts ActiveRecord::Base.connected?"
Expected behavior
The above command to print false
Actual behavior
It prints true
System configuration
Database: Postgres 11.3
Apartment version: 2.2.0
Apartment config (in
config/initializers/apartment.rb
or so):use_schemas
:true
Rails (or ActiveRecord) version: 5.1
Ruby version: 2.5.5
Apartment::Railtie
callsApartment::Tenant.init
duringto_prepare
, which is executed during application boot. This means that a connection is established before user code gets to run.This is problematic as it disallows booting the rails application if the database server is down or unavailable:
This means that certain tasks, which shouldn't require a database, now do.
The text was updated successfully, but these errors were encountered: