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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/legion/cache/redis.rb +5 -4
- data/lib/legion/cache/settings.rb +2 -2
- data/lib/legion/cache/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9f7b5b5352d50ed073af5771dd82ce824db96f0cc508beb942250dfc447428df
|
|
4
|
+
data.tar.gz: 42f6988a094eaaf4ba63c0b91ac35dd614c91bba256f574e2b97a93df4d63686
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/legion/cache/redis.rb
CHANGED
|
@@ -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:
|
|
59
|
+
reconnect_attempts: [0, 0.25, 0.5].freeze
|
|
60
60
|
}
|
|
61
61
|
end
|
|
62
62
|
|
data/lib/legion/cache/version.rb
CHANGED