-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Update PostgresStorageAdapter.js #3578
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
Conversation
proper database API, via transaction.
fixing bracket.
@vitaly-t updated the pull request - view changes |
adding the same rejection approach as before, the functionality remains identical.
@vitaly-t updated the pull request - view changes |
return t.batch(promises); | ||
}) | ||
.then(data => { | ||
debug(`initialzationDone in ${data.duration}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: should be initialization
return Promise.all(promises).then(() => { | ||
debug(`initialzationDone in ${new Date().getTime() - now}`); | ||
}, () => {}); | ||
.catch(error => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm. so if you catch the error and then do nothing with it is that the right thing? will parse server fail? should it?
i'm assuming you're using console instead of logger cause we can't know that the logger is available yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The end result after the change should be identical to what it was, except the integrity is ensured + using just one connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, nit typo and a question for you....
@vitaly-t updated the pull request - view changes |
@vitaly-t updated the pull request - view changes |
lint fixing
@vitaly-t updated the pull request - view changes |
After a few tweaks it is good for merging now ;) |
fixing misspelling.
@vitaly-t updated the pull request - view changes |
@vitaly-t hm so this may be problematic it appears.
|
I only repeated what was written into the console previously.
Which tests? As far as I can see they all succeed. |
https://travis-ci.org/ParsePlatform/parse-server/jobs/207943837 so there's the output issue. i do know that this wasn't showing up before. bad me! I've just be re-running failing tests to get them to pass. would be good if i could figure out how to highlight flakey tests.... in any event, if any fail today, i wont rerun or at least i'll catch the output and put it here. |
That, plus the code isn't very solid. It doesn't use transactions where it should, so often data or structure become inconsistent. My change was to start fixing that, but it requires more than that to fix the whole, to patch the data integrity. To that end you have all the right tools, transactions via pg-promise are trivial to implement, just takes good understanding of the existing code, how to make the change right ;) |
can you look into quieting the output in the tests if it isn't an issue? |
What you see there are errors, clearly an issue. You simply output the error, which is of type |
proper database API usage, via transaction.