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

Passing 'lock' command to redis as is; blind passthrough has been deprecated.. #111

Open
nthx opened this issue Dec 9, 2015 · 2 comments

Comments

@nthx
Copy link

nthx commented Dec 9, 2015

Hi,

I'd like to know how to get around this warning from the subject.
I'm using stack of: Redis, redis-namespace gem (indirectly) and mlanett-redis-lock gem.

mlanett-redis-lock gem monkey-patches Redis namespace, by adding 2 lock / unlock methods.
https://github.com/mlanett/redis-lock/blob/master/lib/redis-lock.rb#L229

In this situation I would expect redis-namespace to skip printing warnings. I know what I'm doing here, and would like to exclude these 2 methods from being warning.
Is it possible?
Can you suggest an approach in this case?

@thijsnado
Copy link

@nthx the following seemed to have work for me (I put this in a config/initializers file in my rails app):

require 'redis/namespace'

Redis::Namespace::COMMANDS['lock'] = :all
Redis::Namespace::COMMANDS['unlock'] = :all

@mkaito
Copy link

mkaito commented May 19, 2017

In case anyone ends up here looking for the fix above, you will want to set an array of symbols, rather than a symbol:

require 'redis/namespace'

Redis::Namespace::COMMANDS['lock'] = [:all]

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

No branches or pull requests

3 participants