Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with Redis 5.0.7+ #513

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions gemfiles/redis_5.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/semian/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
require "redis"

if Redis::VERSION >= "5"
gem "redis", ">= 5.0.3"
gem "redis", ">= 5.0.7"
gem "redis-client", ">= 0.19.0"
require "semian/redis/v5"
return
end
Expand Down
6 changes: 2 additions & 4 deletions lib/semian/redis/v5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,16 @@ def semian_identifier
end

module RedisV5Client
private

def translate_error!(error)
redis_error = translate_error_class(error.class)
if redis_error < ::Semian::AdapterError
redis_error = redis_error.new(error.message)
redis_error.semian_identifier = semian_identifier
redis_error.semian_identifier = error.semian_identifier
end
raise redis_error, error.message, error.backtrace
end
end
end

::Redis.prepend(Semian::RedisV5)
::Redis::Client.prepend(Semian::RedisV5Client)
::Redis::Client.singleton_class.prepend(Semian::RedisV5Client)