legion-cache 1.3.19 → 1.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d491473adc0cc25e2737e471f1dbc644544e2bbc25c67d9ab8e1402836c9f9a7
4
- data.tar.gz: dd72aaf34ad2f97c37117a9b882a9cf76a34a4bd6d1701316a42eff5dafb1317
3
+ metadata.gz: 9f7b5b5352d50ed073af5771dd82ce824db96f0cc508beb942250dfc447428df
4
+ data.tar.gz: 42f6988a094eaaf4ba63c0b91ac35dd614c91bba256f574e2b97a93df4d63686
5
5
  SHA512:
6
- metadata.gz: 756116bb625d9aafc055c12c835777e91d1defbe9cc1308a1021789ac27a64382fcc1fb5378d78afb365cc96f0f6a403330d2c4694d151be2bd2c13631303f4c
7
- data.tar.gz: 117f46e60ca535ee8ce0c4080e3a6f8c71e2cade0ea023ff6edd1fff6ad96cce2ee43448184400f90d5ce58980f58a54f00dc710c5f1fd53127e9a59745a624c
6
+ metadata.gz: 155a80836657e0f8e0d1260ad02d2082fa82f80fed10f7f861d794fc47e7538dbe70305c2561d99e457fe5e8ee2c40d09985bd1a5c8351cb9a2cc26913f43804
7
+ data.tar.gz: c17d8a5c0a71f85488713ccbff577d5b7beb4f7a88126a393c1978d7f6a89c20e71f3ede41ce8e7d1f214664a24c72eb7dba3f2d2d8dd5a09363c0b7cda66ce2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.3.20] - 2026-03-31
6
+
7
+ ### Fixed
8
+ - Forward `timeout` setting to `::Redis.new` — was silently using redis gem's 1.0s default instead of configured 5s, causing spurious timeouts on service mesh connections
9
+ - Forward `timeout` to `::Redis.new` in cluster mode path as well
10
+
11
+ ### Changed
12
+ - Increase `reconnect_attempts` from `1` to `[0, 0.5, 1]` (shared) / `[0, 0.25, 0.5]` (local) — 3 retries with escalating backoff instead of 1 instant retry, improving resilience for service mesh and remote Redis connections
13
+
5
14
  ## [1.3.19] - 2026-03-31
6
15
 
7
16
  ### Added
@@ -12,7 +12,7 @@ module Legion
12
12
  extend self
13
13
 
14
14
  def client(pool_size: 20, timeout: 5, server: nil, servers: [], cluster: nil, replica: false, # rubocop:disable Metrics/ParameterLists
15
- fixed_hostname: nil, username: nil, password: nil, db: nil, reconnect_attempts: 1, **)
15
+ fixed_hostname: nil, username: nil, password: nil, db: nil, reconnect_attempts: [0, 0.5, 1], **)
16
16
  return @client unless @client.nil?
17
17
 
18
18
  @pool_size = pool_size
@@ -31,10 +31,10 @@ module Legion
31
31
  end
32
32
 
33
33
  def build_redis_client(server: nil, servers: [], cluster: nil, replica: false, fixed_hostname: nil, # rubocop:disable Metrics/ParameterLists
34
- username: nil, password: nil, db: nil, reconnect_attempts: 1)
34
+ username: nil, password: nil, db: nil, reconnect_attempts: [0, 0.5, 1])
35
35
  nodes = Array(cluster).compact
36
36
  if nodes.any?
37
- opts = { cluster: nodes, reconnect_attempts: reconnect_attempts }
37
+ opts = { cluster: nodes, reconnect_attempts: reconnect_attempts, timeout: @timeout }
38
38
  opts[:replica] = true if replica
39
39
  opts[:fixed_hostname] = fixed_hostname unless fixed_hostname.nil?
40
40
  opts[:username] = username unless username.nil?
@@ -45,7 +45,8 @@ module Legion
45
45
  driver: 'redis', server: server, servers: servers
46
46
  )
47
47
  host, port = resolved.first.split(':')
48
- redis_opts = { host: host, port: port.to_i, reconnect_attempts: reconnect_attempts }
48
+ redis_opts = { host: host, port: port.to_i, reconnect_attempts: reconnect_attempts,
49
+ timeout: @timeout }
49
50
  redis_opts[:username] = username unless username.nil?
50
51
  redis_opts[:password] = password unless password.nil?
51
52
  redis_opts[:db] = db unless db.nil?
@@ -33,7 +33,7 @@ module Legion
33
33
  username: nil,
34
34
  password: nil,
35
35
  db: nil,
36
- reconnect_attempts: 1
36
+ reconnect_attempts: [0, 0.5, 1].freeze
37
37
  }
38
38
  end
39
39
 
@@ -56,7 +56,7 @@ module Legion
56
56
  username: nil,
57
57
  password: nil,
58
58
  db: nil,
59
- reconnect_attempts: 1
59
+ reconnect_attempts: [0, 0.25, 0.5].freeze
60
60
  }
61
61
  end
62
62
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Cache
5
- VERSION = '1.3.19'
5
+ VERSION = '1.3.20'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.19
4
+ version: 1.3.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity