Skip to content

Commit 6e388d0

Browse files
authored
Remove warning (#167)
* 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. ``` * Use alternative solution
1 parent b1a35c5 commit 6e388d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

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

117117
def initialized_internal?
118-
with_connection { |redis| redis.exists(inited_key) }
118+
with_connection do |redis|
119+
redis.respond_to?(:exists?) ? redis.exists?(inited_key) : redis.exists(inited_key)
120+
end
119121
end
120122

121123
def stop

0 commit comments

Comments
 (0)