Skip to content

Commit aa3115f

Browse files
committed
Remove warning
``` `Redis#exists(key)` will return an Integer in redis-rb 4.3. `exists?` returns a boolean, you should use it instead. To opt-in to the new behavior now you can set Redis.exists_returns_integer = true. To disable this message and keep the current (boolean) behaviour of 'exists' you can set `Redis.exists_returns_integer = false`, but this option will be removed in 5.0. ```
1 parent fa93b41 commit aa3115f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/ldclient-rb/impl/integrations/redis_impl.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ def upsert_internal(kind, new_item)
115115
end
116116

117117
def initialized_internal?
118-
with_connection { |redis| redis.exists(inited_key) }
118+
if Gem::Version.new(::Redis::VERSION) >= Gem::Version.new('4.2.0')
119+
with_connection { |redis| redis.exists?(inited_key) }
120+
else
121+
with_connection { |redis| redis.exists(inited_key) }
122+
end
119123
end
120124

121125
def stop

0 commit comments

Comments
 (0)