-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recover from three kinds of init error
- discovering migrations pending on dfe-analytics init - discovering missing database connection when database not present - loading models before connecting to DB The final example is important because some environments which lack db connections (eg asset precompilation) also don't provide all necessary eg ENV vars which would be required were we loading the whole app (which this init process does). So discover early if we have no database (call ActiveRecord::Base.connection). If anything happens during Fields.check! catch that too). Log lines will tell us if we're bailing for want of a DB or for want of a migration. (There's no point in running check! if migration yet to run).
- Loading branch information
1 parent
2e39358
commit ba6f618
Showing
2 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters