redis-cluster-client 0.8.1 → 0.8.2

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: 53d1591b89859ddc92dc6ca349ff211d0a6ac14c68ad72e920cc9725d82587b4
4
- data.tar.gz: fcfeceffddc9201f8b8c5d6999d3e7aa8581c9f24f0d823b029a5561ef82887d
3
+ metadata.gz: 7986c9cc2ea7af5a128397b327e1a4b001740ac6a49af09d8f3ed507665b39d9
4
+ data.tar.gz: fcb8ef4cbc7095b8b57f9570b24dd4dc4d9b4a517b0e9d2451aa9c740c676989
5
5
  SHA512:
6
- metadata.gz: d51aefc48e64ef0cdbded8b5c8e4b005dcfd103d9fa4ecfa0dff1d9aa4fed5d6f6aefd4dca4ac53e89867b5276812bc6c7f8cf3cb41c1184bd9d8f19ea601471
7
- data.tar.gz: 548da631726b4881f0a7712186f656733cb6941aef9ca3415498a6f048f59170fb74a59c30da68d655cee5e5773732d9d781c489f6cda2f0c92a341f1b28b892
6
+ metadata.gz: d2624fa1a7ff96f625816beb5f53cac2727c1649f44cb4170f2c744b60f8f4b03eb4ba764cfaba41d867f73807b24965c3fbd2938b3875d0cabf37ccf69bcf32
7
+ data.tar.gz: b062efff7fea22cda0379c8749c00315d949ad82d491b93307f3c8f42f2af0b563d3af270a1c63bb7b497c9e826f33369618e5dd93fe58415b6097eea9f600b9
@@ -106,6 +106,7 @@ class RedisClient
106
106
  @topology = klass.new(pool, @concurrent_worker, **kwargs)
107
107
  @config = config
108
108
  @mutex = Mutex.new
109
+ @last_reloaded_at = nil
109
110
  end
110
111
 
111
112
  def inspect
@@ -8,6 +8,7 @@ class RedisClient
8
8
  class Transaction
9
9
  ConsistencyError = Class.new(::RedisClient::Error)
10
10
  MAX_REDIRECTION = 2
11
+ EMPTY_ARRAY = [].freeze
11
12
 
12
13
  def initialize(router, command_builder, node: nil, slot: nil, asking: false)
13
14
  @router = router
@@ -62,10 +63,10 @@ class RedisClient
62
63
  def execute
63
64
  @pending_commands.each(&:call)
64
65
 
65
- raise ArgumentError, 'empty transaction' if @pipeline._empty?
66
+ return EMPTY_ARRAY if @pipeline._empty?
66
67
  raise ConsistencyError, "couldn't determine the node: #{@pipeline._commands}" if @node.nil?
67
68
 
68
- settle
69
+ commit
69
70
  end
70
71
 
71
72
  private
@@ -92,8 +93,17 @@ class RedisClient
92
93
  @pending_commands.clear
93
94
  end
94
95
 
95
- def settle
96
+ def commit
96
97
  @pipeline.call('EXEC')
98
+ settle
99
+ end
100
+
101
+ def cancel
102
+ @pipeline.call('DISCARD')
103
+ settle
104
+ end
105
+
106
+ def settle
97
107
  # If we needed ASKING on the watch, we need ASKING on the multi as well.
98
108
  @node.call('ASKING') if @asking
99
109
  # Don't handle redirections at this level if we're in a watch (the watcher handles redirections
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-cluster-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-13 00:00:00.000000000 Z
11
+ date: 2024-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client