diff --git a/Gemfile.checksum b/Gemfile.checksum index a13b56f3af48d927f8441c6d3b955139dd057c64..c1ea476164ac6851c85a9d54a9de897453c0455d 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -551,7 +551,7 @@ {"name":"redcarpet","version":"3.6.0","platform":"ruby","checksum":"8ad1889c0355ff4c47174af14edd06d62f45a326da1da6e8a121d59bdcd2e9e9"}, {"name":"redis","version":"5.2.0","platform":"ruby","checksum":"336b975a56b166c6af4d4a1026c71dbed429ba5dc949aac373ef2fded07936b4"}, {"name":"redis-actionpack","version":"5.4.0","platform":"ruby","checksum":"f10cf649ab05914716d63334d7f709221ecc883b87cf348f90ecfe0c35ea3540"}, -{"name":"redis-client","version":"0.22.1","platform":"ruby","checksum":"b411b3812e83f817069dc20651dd3b01d4d417a0cab0f04fbaf143d6de19107e"}, +{"name":"redis-client","version":"0.22.2","platform":"ruby","checksum":"31fee4b7cf04109b227327fabeaaf1fc5b652cf48a186a03bc607e40767bacc0"}, {"name":"redis-cluster-client","version":"0.8.2","platform":"ruby","checksum":"1ced1b8a86e2bd57d297de35194e06f84da306f22c13cfbb7103e6458055eb80"}, {"name":"redis-clustering","version":"5.2.0","platform":"ruby","checksum":"685f388e0bdd81091a96cce9a46e22e727213d5fa14ebfc5111e110440e0038e"}, {"name":"redis-namespace","version":"1.11.0","platform":"ruby","checksum":"e91a1aa2b2d888b6dea1d4ab8d39e1ae6fac3426161feb9d91dd5cca598a2239"}, diff --git a/Gemfile.lock b/Gemfile.lock index b37307cc45ae542087091f3eb1c2a6d4df13e511..8f07f9233fbe44ab0f7ee67b6943b0d5f203a194 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1484,7 +1484,7 @@ GEM actionpack (>= 5, < 8) redis-rack (>= 2.1.0, < 4) redis-store (>= 1.1.0, < 2) - redis-client (0.22.1) + redis-client (0.22.2) connection_pool redis-cluster-client (0.8.2) redis-client (~> 0.22) diff --git a/config/initializers/redis_client_patch.rb b/config/initializers/redis_client_patch.rb deleted file mode 100644 index 80bfc2798737384f8119647407567c4ba2532f5c..0000000000000000000000000000000000000000 --- a/config/initializers/redis_client_patch.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -require 'redis-client' - -# This patch can be dropped once https://github.com/redis-rb/redis-client/pull/197 -# is released and merged. -if Gem::Version.new(RedisClient::VERSION) > Gem::Version.new('0.22.1') # rubocop:disable Style/GuardClause -- This is easier to read - raise 'New version of redis-client detected, please remove this file' -end - -# rubocop:disable Gitlab/ModuleWithInstanceVariables -- This is an upstream gem -# rubocop:disable Style/GuardClause -- This is an upstream gem -class RedisClient - module ConnectionMixin - def call(command, timeout) - @pending_reads += 1 - write(command) - result = read(connection_timeout(timeout)) - @pending_reads -= 1 - if result.is_a?(Error) - result._set_command(command) - result._set_config(config) - raise result - else - result - end - end - - def call_pipelined(commands, timeouts, exception: true) - first_exception = nil - - size = commands.size - results = Array.new(commands.size) - @pending_reads += size - write_multi(commands) - - size.times do |index| - timeout = timeouts && timeouts[index] - result = read(connection_timeout(timeout)) - @pending_reads -= 1 - - # A multi/exec command can return an array of results. - # An error from a multi/exec command is handled in Multi#_coerce!. - if result.is_a?(Array) - result.each do |res| - res._set_config(config) if res.is_a?(Error) - end - elsif result.is_a?(Error) - result._set_command(commands[index]) - result._set_config(config) - first_exception ||= result - end - - results[index] = result - end - - if first_exception && exception - raise first_exception - else - results - end - end - - def connection_timeout(timeout) - return timeout unless timeout && timeout > 0 - - # Can't use the command timeout argument as the connection timeout - # otherwise it would be very racy. So we add the regular read_timeout on top - # to account for the network delay. - timeout + config.read_timeout - end - end -end -# rubocop:enable Gitlab/ModuleWithInstanceVariables -# rubocop:enable Style/GuardClause