Skip to content
代码片段 群组 项目
未验证 提交 bdf97a73 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Update redis-client to v0.22.2

This drops the patch for the `redis-client` gem introduced in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/153282 to avoid
timeout errors with BLPOP/BRPOP commands when talking to Redis
Sentinels.

Full diff: https://my.diffend.io/gems/redis-client/0.22.1/0.22.2

Changelog: changed
上级 a56a49b0
No related branches found
No related tags found
无相关合并请求
......@@ -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"},
......
......@@ -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)
......
# 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
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册