-
Notifications
You must be signed in to change notification settings - Fork 157
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
Support Redis-rb v5 #314
Support Redis-rb v5 #314
Conversation
a5662c7
to
987bc93
Compare
assert_valid_integer(seconds) | ||
seconds = Integer(seconds) |
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.
These changes mimic how redis-rb
handles the number conversion
raise Redis::CommandError, 'BUSYKEY Target key name already exists.' | ||
raise Error.command_error('BUSYKEY Target key name already exists.', self) |
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 change is tested only with MockRedis
and not with the multiplexer.
rescue Redis::CommandError => e | ||
raise Error.command_error(e.message, self) |
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.
I can't access connection URL inside Stream
object so I need to rescue the error & wrap it here
987bc93
to
8a974a4
Compare
8a974a4
to
9477e66
Compare
Phenomenal effort—thank you. If after release bugs are found related to this change, I will redirect any issues opened to you for the time being (unless trivial to address myself). Thanks again. |
This is an attempt to fix #281. This PR was also tested using the test suite of our service.
There are a few decisions I made regarding this PR, please let me know if it's not appropriate:
MockRedis::Error
module which decorateRedis::CommandError
and related errors with the connection URLRedis::CommandError
with the new module wrapperexists_returns_integer
is removedassert_type
is added to validate the arguments. Currently it doesn't look very clean, so any improvements would be great.sadd
,srem
now support multiple argumentsmulti
now needs to call with a block anddiscard
/exec
cannot be called outside that block anymore