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

Fix: a jedis client returning destination #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kamekoopa
Copy link

A client has to be returned to the broken client pool, when an exception occurred.

@pk11
Copy link
Owner

pk11 commented Jul 6, 2013

thanks for this, however, it's not really idiomatic in scala to use a var like this or null.instanceOf
could you please modify it using
http://danielwestheide.com/blog/2012/12/26/the-neophytes-guide-to-scala-part-6-error-handling-with-try.html
?
if not, I will fix it.

Thanks

@kamekoopa
Copy link
Author

I tried to fix using the way of error handling that you pointed out.
If this fix is inappropriateness, I'm sorry to bother you, but could you please fix this issue yourself?

}
result.get
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's almost same as withJedisClient. Better to write as withJedisClient(jedis => body(Dress.up(jedis))).

A client has to be returned to the broken client pool, when an exception occurred.
@kamekoopa
Copy link
Author

removed duplicate code on @tkawachi 's suggestion, and rebased.
(I'm sorry. Target-lines that comment points was disappeared.)

val result = Try(body(jedis))

result match {
case Failure(e:JedisConnectionException) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this exception is not logged, so the client won't be aware of this event.

@dontgitit dontgitit mentioned this pull request Sep 1, 2017
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.

3 participants