-
Notifications
You must be signed in to change notification settings - Fork 21
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
Automatically select db on new connection creation in pool #34
Automatically select db on new connection creation in pool #34
Conversation
great ! just a little change proposal |
Ok. What should I do? |
@@ -88,6 +91,10 @@ def get_connected_client(self): | |||
LOG.warning("can't connect to %s", client.title) | |||
raise tornado.gen.Return(ClientError("can't connect to %s" % | |||
client.title)) | |||
|
|||
if self.db != 0: | |||
yield client.call('SELECT', self.db) |
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.
can you add a test about the result of the SELECT command and raise a tornado.gen.Return(ClientError("something")) if there is a problem here ?
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.
raise a tornado.gen.Return(ClientError("something"))
Done.can you add a test about the result
I have no idea how to figure out what db is selected right now (
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.
One more thing.
Please make release after this feature will be merged.
It seems good for me, I merge it |
Thank you. |
I just moved your db selection code from pool to client object. Same behaviour but you don't have db property anymore on the pool object (but on the client object) Can you test it ? |
Thanks. It works for me. |
No description provided.