Test connectivity while registering data store#290
Closed
bhargavkn wants to merge 4 commits intobalderdashy:masterfrom
Closed
Test connectivity while registering data store#290bhargavkn wants to merge 4 commits intobalderdashy:masterfrom
bhargavkn wants to merge 4 commits intobalderdashy:masterfrom
Conversation
Author
|
@eashaw Requesting an early set of eyes on this PR to figure out if it's going in the right direction before I write tests for it 🙇♂️ |
eashaw
reviewed
Sep 13, 2021
Member
eashaw
left a comment
There was a problem hiding this comment.
Hi @bhargavkn, I've tested this and it works as expected.
Do you think you would be able to handle this by testing the connection before registerDataStore() and without making any changes register-data-store.js?
Author
|
@eashaw sure, will try it out and update this PR with the changes soon. |
Author
|
@eashaw may I please have another round of review on this PR? 🙇 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes in this PR attempt to resolve balderdashy/sails#7095 by Introducing and exposing a new method
validateConnectionthat is called by waterline after a datastore is registered to check database connectivity. The method tests connectivity by attempting to acquire and release a connection to the database.If either of (a) acquiring a connection or (b) subsequent release of connection fails,
validate-connectionreturns an error.The other half of the complete fix lies here: balderdashy/waterline#1621