diff --git a/lib/remote_lock/adapters/redis.rb b/lib/remote_lock/adapters/redis.rb index 88f5d52..ff6d2f3 100644 --- a/lib/remote_lock/adapters/redis.rb +++ b/lib/remote_lock/adapters/redis.rb @@ -18,7 +18,7 @@ def store(key, expires_in_seconds) # check if another client has the key. # it's important to still run a transaction to clear the watch. - have_competition = @connection.exists(key) + have_competition = @connection.respond_to?(:exists?) ? @connection.exists?(key) : @connection.exists(key) !! @connection.multi do break if have_competition