Skip to content

Commit

Permalink
Fix compatibility with Redis 5.0.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Nov 16, 2023
1 parent 7340489 commit 83bacec
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
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.

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

if Redis::VERSION >= "5"
gem "redis", ">= 5.0.3"
gem "redis", ">= 5.0.7"
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)

0 comments on commit 83bacec

Please sign in to comment.