From bc7d70593f58c04a160616f5398e97217ed09531 Mon Sep 17 00:00:00 2001 From: Aristoteles Costa Date: Fri, 10 Apr 2026 20:28:55 -0300 Subject: [PATCH 1/4] fix: remove deprecated redis.replicate_commands() from leaky_bucket.lua This Lua command was required for Redis < 5.0 to enable effects replication\nin scripts that mix reads and writes. Since Redis 5.0 this is the default\nbehavior. The call is a no-op in Redis 5/6/7.0, deprecated in 7.1, and\nerrors in Redis 7.2+. --- lib/prorate/leaky_bucket.lua | 3 --- 1 file changed, 3 deletions(-) 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 From 4604049f62016e10eea00a8f525954ec7a3e8544 Mon Sep 17 00:00:00 2001 From: Aristoteles Costa Date: Fri, 10 Apr 2026 20:29:10 -0300 Subject: [PATCH 2/4] fix: remove deprecated redis.replicate_commands() from rate_limit.lua Same change as the previous commit, applied to the throttle Lua script.\nRequired for Redis 7.2+ compatibility. --- lib/prorate/rate_limit.lua | 2 -- 1 file changed, 2 deletions(-) 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 From 0478d2bd8ea2f5010acd3240415af6814b262c35 Mon Sep 17 00:00:00 2001 From: Aristoteles Costa Date: Fri, 10 Apr 2026 20:30:23 -0300 Subject: [PATCH 3/4] fix: require redis gem >= 4 redis gem 2.x (last release 2015) and 3.x (last release 2018) are\nno longer maintained. The new floor aligns with the implicit Redis\nserver 5.0+ requirement after removing replicate_commands(). --- prorate.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From 64b5e39cb51a8e25c6ea184b658d137f84fa3462 Mon Sep 17 00:00:00 2001 From: Aristoteles Costa Date: Fri, 10 Apr 2026 20:31:09 -0300 Subject: [PATCH 4/4] chore: bump version to 0.8.0 --- CHANGELOG.md | 6 ++++++ lib/prorate/version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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/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