Skip to content

Fix call to migrate. #1593

Closed
wants to merge 1 commit into from

2 participants

@badboy
badboy commented Mar 11, 2014

The redis-rb client takes the additional info as an options hash, not as additional arguments.

I'm using redis-rb v3.0.7, which takes only two arguments, see https://github.com/redis/redis-rb/blob/master/lib/redis.rb#L399
I couldn't find the code that it ever took 5 arguments, so I think this code in redis-trib.rb should have never worked.

@badboy badboy Fix call to migrate.
The redis-rb client takes the additional info as an options hash, not as additional arguments.
2f7709d
@antirez
Owner
antirez commented Mar 11, 2014

That's strange, with v 3.0.7 works well. Is it possible that it depends on the Ruby version used?

@antirez
Owner
antirez commented Mar 11, 2014

I mean, 3.0.3

@badboy
badboy commented Mar 11, 2014

I see. Support for MIGRATE was added only in 3.0.5¹, before that it relied on method_missing, which just passes all arguments down.

¹: redis/redis-rb@3e7277d

@antirez
Owner
antirez commented Mar 11, 2014

Oh, that's pretty terrible. Thanks @badboy. It means that basically there is no way to patch it if not to use a check for the method existence. Please could you rework the patch so that it uses respond_to? :migrate to switch between the two behavior?

@antirez
Owner
antirez commented Mar 11, 2014

(or I can do myself, I asked you to commit the change since you discovered how it works :-)

@antirez antirez added a commit that referenced this pull request Mar 11, 2014
@antirez redis-trib: call MIGRATE via r.client.call as fix for redis-rb API ch…
…anges.

See issue #1593.

Thanks to @badboy for suggesting the direct client.call fix.
cc11d10
@badboy badboy closed this Mar 12, 2014
@badboy badboy deleted the badboy:patch-6 branch Mar 12, 2014
@antirez antirez added a commit that referenced this pull request Mar 15, 2014
@antirez redis-trib: call MIGRATE via r.client.call as fix for redis-rb API ch…
…anges.

See issue #1593.

Thanks to @badboy for suggesting the direct client.call fix.
32f188c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.