Skip to content
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

Prevent getting table info if not connected to db #814

Conversation

cbliard
Copy link
Contributor

@cbliard cbliard commented Jan 19, 2017

Fixes #327

When precompiling assets while building a docker image, the database is not
available and the DeviseTokenAuth::Concerns::User concern tries to load
user table information from database and fails. It now checks if the
database connection is established before gathering information about user
table.

@booleanbetrayal
Copy link
Collaborator

this is failing on Travis @cbliard . Will need you to take a look before I can merge.

Fixes lynndylanhurley#327

When precompiling assets while building a docker image, the database is not
available and the DeviseTokenAuth::Concerns::User concern tries to load
user table information from database and fails. It now checks if the
database connection is available before gathering information about user
table.
@cbliard cbliard force-pushed the fix-327-concern-cause-app-to-connect-to-db branch from 6d9ee77 to 6d764da Compare January 20, 2017 08:20
@cbliard
Copy link
Contributor Author

cbliard commented Jan 20, 2017

@booleanbetrayal Sorry, I did not notice. I just fixed it.

@booleanbetrayal booleanbetrayal merged commit 98c0348 into lynndylanhurley:master Jan 21, 2017
@booleanbetrayal
Copy link
Collaborator

thanks @cbliard !

@cbliard cbliard deleted the fix-327-concern-cause-app-to-connect-to-db branch January 23, 2017 09:37
@cbliard cbliard restored the fix-327-concern-cause-app-to-connect-to-db branch January 23, 2017 09:37
@cbliard
Copy link
Contributor Author

cbliard commented Jan 23, 2017

In fact, this implementation is far from ideal. It fails to catch connection errors with PostgreSQL which raises PG::ConnectionBad. I changed the implementation to check if the connection is active and catch any errors: hiptest@3e8657f

Should I open a new pull request or is it possible to change this one?

@booleanbetrayal
Copy link
Collaborator

@cbliard - this has already been merged. Please just open a new PR and ping me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants