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

Automatically select db on new connection creation in pool #34

Merged
merged 5 commits into from
Sep 25, 2016

Conversation

marrrvin
Copy link

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 89.859% when pulling 821d02d on marrrvin:select-db-on-new-connection-in-pool into 6cc78c2 on thefab:master.

@thefab
Copy link
Owner

thefab commented Sep 21, 2016

great ! just a little change proposal

@marrrvin
Copy link
Author

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)
Copy link
Owner

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 ?

Copy link
Author

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 (

Copy link
Author

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 89.902% when pulling c5803c9 on marrrvin:select-db-on-new-connection-in-pool into 6cc78c2 on thefab:master.

@thefab
Copy link
Owner

thefab commented Sep 25, 2016

It seems good for me, I merge it

@thefab thefab merged commit abc49a0 into thefab:master Sep 25, 2016
@marrrvin
Copy link
Author

Thank you.
Can you make new release, please?

@thefab
Copy link
Owner

thefab commented Sep 26, 2016

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 ?

@marrrvin
Copy link
Author

Thanks. It works for 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.

None yet

4 participants