diff --git a/CHANGELOG.md b/CHANGELOG.md index b01a60d..4ba7172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.8.0 + +* Remove `redis.replicate_commands()` from Lua scripts for Redis 7.2+ compatibility. + This call was required for Redis < 5.0 and has been removed in Redis 7.2. +* Require `redis` gem >= 4 (previously >= 2). Versions 2.x and 3.x are no longer maintained. + # 0.7.1 * Fix use of a ConnectionPool as `redis:` argument which was broken in 0.7.0 diff --git a/lib/prorate/leaky_bucket.lua b/lib/prorate/leaky_bucket.lua index 75d2fab..a871159 100644 --- a/lib/prorate/leaky_bucket.lua +++ b/lib/prorate/leaky_bucket.lua @@ -2,9 +2,6 @@ -- args: key_base, leak_rate, bucket_ttl, fillup. To just verify the state of the bucket leak_rate of 0 may be passed. -- returns: the leve of the bucket in number of tokens --- this is required to be able to use TIME and writes; basically it lifts the script into IO -redis.replicate_commands() - -- Redis documentation recommends passing the keys separately so that Redis -- can - in the future - verify that they live on the same shard of a cluster, and -- raise an error if they are not. As far as can be understood this functionality is not diff --git a/lib/prorate/rate_limit.lua b/lib/prorate/rate_limit.lua index 749a966..c40544f 100644 --- a/lib/prorate/rate_limit.lua +++ b/lib/prorate/rate_limit.lua @@ -4,8 +4,6 @@ -- if the block time is nonzero, the second integer is always zero. If the block time is zero, -- the second integer indicates the level of the bucket --- this is required to be able to use TIME and writes; basically it lifts the script into IO -redis.replicate_commands() -- make some nicer looking variable names: local retval = nil diff --git a/lib/prorate/version.rb b/lib/prorate/version.rb index 5416624..a2e89d2 100644 --- a/lib/prorate/version.rb +++ b/lib/prorate/version.rb @@ -1,3 +1,3 @@ module Prorate - VERSION = "0.7.3" + VERSION = "0.8.0" end diff --git a/prorate.gemspec b/prorate.gemspec index 0b6f855..03b6526 100644 --- a/prorate.gemspec +++ b/prorate.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "redis", ">= 2" + spec.add_dependency "redis", ">= 4" spec.add_development_dependency "connection_pool", "~> 2" spec.add_development_dependency "bundler" spec.add_development_dependency "rake", "~> 13.0"