used redis.exists? instead of redis.exists as the latter is deprecated
MODIFY
beetle.gemspec
beetle.gemspec
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.specification_version = 3
s.add_runtime_dependency "bunny", "~> 0.7.12"
- s.add_runtime_dependency "redis", ">= 2.2.2"
+ s.add_runtime_dependency "redis", ">= 4.2.1"
s.add_runtime_dependency "hiredis", ">= 0.4.5"
s.add_runtime_dependency "amq-protocol", "= 2.3.0"
s.add_runtime_dependency "amqp", "= 1.8.0"

MODIFY
lib/beetle/deduplication_store.rb
lib/beetle/deduplication_store.rb
@@ -120,7 +120,7 @@ module Beetle
# check whether key with given suffix exists for a given <tt>msg_id</tt>.
def exists(msg_id, suffix)
- with_failover { redis.exists(key(msg_id, suffix)) }
+ with_failover { redis.exists?(key(msg_id, suffix)) }
end
# flush the configured redis database. useful for testing.

MODIFY
test/beetle/deduplication_store_test.rb
test/beetle/deduplication_store_test.rb
@@ -9,7 +9,7 @@ module Beetle
end
test "trying to delete a non existent key doesn't throw an error" do
- assert !@r.exists("hahahaha")
+ assert !@r.exists?("hahahaha")
assert_equal 0, @r.del("hahahaha")
end

MODIFY
test/beetle/message_test.rb
test/beetle/message_test.rb
@@ -142,7 +142,7 @@ module Beetle
message.process(@null_handler)
keys = @store.keys(message.msg_id)
keys.each do |key|
- assert !@store.redis.exists(key)
+ assert !@store.redis.exists?(key)
end
end
@@ -159,10 +159,10 @@ module Beetle
message.process(@null_handler)
keys = @store.keys(message.msg_id)
status_key = keys.shift
- assert @store.redis.exists(status_key)
+ assert @store.redis.exists?(status_key)
assert @store.redis.ttl(status_key) <= @config.redis_status_key_expiry_interval
keys.each do |key|
- assert !@store.redis.exists(key)
+ assert !@store.redis.exists?(key)
end
end
@@ -180,7 +180,7 @@ module Beetle
keys = @store.keys(message.msg_id)
keys.each do |key|
- assert !@store.redis.exists(key)
+ assert !@store.redis.exists?(key)
end
end
@@ -199,10 +199,10 @@ module Beetle
keys = @store.keys(message.msg_id)
status_key = keys.shift
- assert @store.redis.exists(status_key)
+ assert @store.redis.exists?(status_key)
assert @store.redis.ttl(status_key) <= @config.redis_status_key_expiry_interval
keys.each do |key|
- assert !@store.redis.exists(key)
+ assert !@store.redis.exists?(key)
end
end

used redis.exists? instead of redis.exists as the latter is deprecated