-
Notifications
You must be signed in to change notification settings - Fork 33
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
base: master
Are you sure you want to change the base?
Fix: a jedis client returning destination #4
Conversation
thanks for this, however, it's not really idiomatic in scala to use a Thanks |
I tried to fix using the way of error handling that you pointed out. |
} | ||
result.get | ||
} |
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.
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.
removed duplicate code on @tkawachi 's suggestion, and rebased. |
val result = Try(body(jedis)) | ||
|
||
result match { | ||
case Failure(e:JedisConnectionException) => { |
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.
this exception is not logged, so the client won't be aware of this event.
A client has to be returned to the broken client pool, when an exception occurred.