cache_store_redis 2.3.0-java → 2.4.0-java

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: f3c336fa1a5395bdaac8ac631081f502905b13f1fb171d95465e8a0bc26abd57
4
- data.tar.gz: bfd8b276a84a795cebc0699d1b893f561b26e3c8568d9db92746cc50724f7d46
3
+ metadata.gz: e785151124f1e0c4423a26acddbc7bea48f92655a63b2c3a3c33cc24d2b25493
4
+ data.tar.gz: 4b89904a6f316fce1181516a120654fd343568af1c12755636337e2c1e6137c1
5
5
  SHA512:
6
- metadata.gz: c7c2d3341798bebd1c89626c0a7c6b901092cd55c09749453c4cf354c453eaebc26008cc222079c09349e09bac4f543781370c89229efeca5a2b9c719c4de7cf
7
- data.tar.gz: 579efc76097b5f9cea183bf964cb5b0c50a9c5288d22240d01e93361dafe7843e31c6960c7168d30615617303593d6e84807d03366f43e5f6291929623730eec
6
+ metadata.gz: acf00267d8299b6365da2935cb2008b0c7d32d0262a61547d4249877038c051e41d5d34edeeccef16c4d0d5f2031a2d8500ab46498de147026a138e56310a33c
7
+ data.tar.gz: '085f3b234b92874c9181b194908b373627b81bf86616c52082c7e98f7b91d15275028cf360b1f299ef6e4c5c3bdc8eb13d71ae0e47166e4c7b6f0fb5c9a4b17d'
@@ -12,29 +12,23 @@ class RedisConnectionPool
12
12
  loop do
13
13
  sleep(1)
14
14
  @mutex.synchronize do
15
- connections.select { |con| con.expired? }.each do |con|
16
- con.close
17
- end
15
+ connections.select(&:expired?).each(&:close)
18
16
  end
19
17
  end
20
18
  end
21
19
  end
22
20
 
23
21
  # This method is called to get the namespace for redis keys.
24
- def namespace
25
- @namespace
26
- end
22
+ attr_reader :namespace
27
23
 
28
24
  # This method is called to get the idle connection queue for this pool.
29
- def queue
30
- @queue
31
- end
25
+ attr_reader :queue
32
26
 
33
27
  # This method is called to fetch a connection from the queue or create a new connection if no idle connections
34
28
  # are available.
35
29
  def fetch_connection
36
30
  queue.pop(true)
37
- rescue
31
+ rescue StandardError
38
32
  RedisConnection.new(config)
39
33
  end
40
34
 
@@ -51,9 +45,7 @@ class RedisConnectionPool
51
45
 
52
46
  # This method is called to checkin a connection to the pool after use.
53
47
  def check_in(connection)
54
- if connection.expired?
55
- connection.close
56
- end
48
+ connection.close if connection.expired?
57
49
  @mutex.synchronize do
58
50
  connections.push(connection)
59
51
  queue.push(connection)
@@ -63,15 +55,13 @@ class RedisConnectionPool
63
55
  # This method is called to use a connection from this pool.
64
56
  def with_connection
65
57
  connection = check_out
66
- return yield connection.client
58
+ yield connection.client
67
59
  ensure
68
- check_in(connection)
60
+ check_in(connection) if connection
69
61
  end
70
62
 
71
63
  # This method is called to get an array of idle connections in this pool.
72
- def connections
73
- @connections
74
- end
64
+ attr_reader :connections
75
65
 
76
66
  def shutdown
77
67
  connections.each do |con|
@@ -1,3 +1,3 @@
1
1
  module CacheStoreRedis
2
- VERSION = '2.3.0'
2
+ VERSION = '2.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache_store_redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: java
6
6
  authors:
7
7
  - vaughanbrittonsage
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-26 00:00:00.000000000 Z
11
+ date: 2024-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement