resque / redis-namespace

This gem adds a Redis::Namespace class which can be used to namespace Redis keys.
http://redis.io
MIT License
695 stars 192 forks source link

Deprecation warning: Redis.current is deprecated and will be removed in 5.0 #189

Closed pedrofurtado closed 2 years ago

pedrofurtado commented 2 years ago

Hello! 👋

Using the latest version of gem redis and redis-namespace, appears a deprecation warning like this below:

`Redis.current=` is deprecated and will be removed in 5.0. (called from: /opt/rubies/3.0/lib/ruby/gems/3.0.0/gems/redis-namespace-1.8.1/lib/redis/namespace.rb:245:in `initialize')

https://github.com/resque/redis-namespace/blob/v1.8.1/lib/redis/namespace.rb#L245

https://github.com/redis/redis-rb/blob/v4.6.0/lib/redis.rb#L39-L48

https://github.com/redis/redis-rb/issues/1064

byroot commented 2 years ago
@redis = options[:redis] || Redis.current

So it's mostly the caller's responsability to pass a Redis instance here.

pedrofurtado commented 2 years ago

@byroot Thanks for feedback! Anyway, when 5.x versions of gem redis be released, the redis-namespace will break because method current will not exists anymore 🤝

I've open a PR suggesting a fix, you eyes/review on it will be awesome 🍻

https://github.com/resque/redis-namespace/pull/190