redis-cluster-client 0.3.11 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7eb062a2819ec74aebd03e23d7fd55281b8bf600bb5dd9bbcfb4cb36086070ef
4
- data.tar.gz: 0bb82a71679f66948d09f07a8e5ccb6b31138e9c1fe7f9d6ab7d10abf35cf473
3
+ metadata.gz: a99b3cb82de7749e845190ab4db8570408706ec659743925d9ebd648ac4af815
4
+ data.tar.gz: 6b12b2ac3844eaf2f9bce51767a84931d3a9b9abf2b235012ce0b4db483797fe
5
5
  SHA512:
6
- metadata.gz: 87727a31dfd4278a353902f31b9bda5f99fe9e0651491f8b2af5bcab16bae819087adff8a8e7ecfdaf81bcd1f99b95e002d66bb4cc44ab690326bcca6c10dd4c
7
- data.tar.gz: d4850893095a151cfe5f47a66642fcc311cd58e3466f46f5d8a1ce1e73374ac3f7faaf6b0bcb6ea1f3b18762c3198fad57af33614514280bcac85bfab2af8b08
6
+ metadata.gz: d33869ee9bbb6ea3f71a90dd18752b5d5f9bd93652b61195f08f88eadfefe363380e1645303dfe1fad4a98992f14fea8e4277e3adadfc9d84f318712a1d59876
7
+ data.tar.gz: 7c1cc1f67ba80f363be78bcaf9b25f1c373356d5c03f9f15c2828f74a6500706311c633c2faec1194ab1d2d2bb1905c355f666820070a7d624730cf86698e576
@@ -8,6 +8,8 @@ class RedisClient
8
8
  class Cluster
9
9
  class Command
10
10
  EMPTY_STRING = ''
11
+ LEFT_BRACKET = '{'
12
+ RIGHT_BRACKET = '}'
11
13
 
12
14
  Detail = Struct.new(
13
15
  'RedisCommand',
@@ -104,10 +106,11 @@ class RedisClient
104
106
  # @see https://redis.io/topics/cluster-spec#keys-hash-tags Keys hash tags
105
107
  def extract_hash_tag(key)
106
108
  key = key.to_s
107
- s = key.index('{')
108
- e = key.index('}', s.to_i + 1)
109
+ s = key.index(LEFT_BRACKET)
110
+ return EMPTY_STRING if s.nil?
109
111
 
110
- return EMPTY_STRING if s.nil? || e.nil?
112
+ e = key.index(RIGHT_BRACKET, s + 1)
113
+ return EMPTY_STRING if e.nil?
111
114
 
112
115
  key[s + 1..e - 1]
113
116
  end
@@ -47,9 +47,9 @@ class RedisClient
47
47
 
48
48
  min = DUMMY_LATENCY_NSEC
49
49
  MEASURE_ATTEMPT_COUNT.times do
50
- starting = Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond)
50
+ starting = Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond)
51
51
  client.send(:call_once, 'PING')
52
- duration = Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond) - starting
52
+ duration = Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond) - starting
53
53
  min = duration if duration < min
54
54
  end
55
55
 
@@ -200,7 +200,7 @@ class RedisClient
200
200
  def send_pipeline(client, pipeline)
201
201
  results = client.send(:ensure_connected, retryable: pipeline._retryable?) do |connection|
202
202
  commands = pipeline._commands
203
- ::RedisClient::Middlewares.call_pipelined(commands, client.config) do
203
+ client.instance_variable_get(:@middlewares).call_pipelined(commands, client.config) do
204
204
  connection.call_pipelined_aware_of_redirection(commands, pipeline._timeouts)
205
205
  end
206
206
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-cluster-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-27 00:00:00.000000000 Z
11
+ date: 2022-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.6'
19
+ version: '0.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0.6'
26
+ version: '0.10'
27
27
  description:
28
28
  email:
29
29
  - proxy0721@gmail.com
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubygems_version: 3.3.15
72
+ rubygems_version: 3.3.22
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: A Redis cluster client for Ruby