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

convert select() to no-op if the current database is the same as target one #66

Merged

Conversation

DRVTiny
Copy link
Contributor

@DRVTiny DRVTiny commented Jun 25, 2018

select() with the same database number as the already selected one leads to no exchange with the Redis server

@stefanwille
Copy link
Owner

Hi @DRVTiny, thanks for your PR.

To me this looks like an optimization for a case that has little practical performance impact?

@DRVTiny
Copy link
Contributor Author

DRVTiny commented Jun 25, 2018 via email

@DRVTiny
Copy link
Contributor Author

DRVTiny commented Oct 18, 2018

stefanwille, this pull request includes setting database as Redis instance attribute as well.
Because of some unobvious bugs in Redis driver code, i've got, for example, connections in Redis::PooledClient pool where select() was not called for some very strange reasons. To debug this case i need to know current @database value... somehow.
It is normal practice to store different kind of Redis objects in different databases. This possibility is a basic Redis functional, so i need to be possible to use it in my Crystal code.

@stefanwille
Copy link
Owner

Merged, thanks!

@stefanwille stefanwille merged commit 3c9b7b2 into stefanwille:master Nov 30, 2019
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.

2 participants