action-cable-redis-backport 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/action-cable-redis-backport.rb +6 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21ba9cf50ede2f8bdac15cc9771ab72c6b0af7507103dd28b7569cf08c438a88
|
4
|
+
data.tar.gz: ca4428362708d50d2b53bcdb5d8939ed5e64b40b45f26409c7d8a388420435aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0176a2c994aed186fed59e2d59f42c6b0e859171a43fc13d98e3e5048c979e172686ad2c7ca5f66b5282c687a0998821fe0ab075c212651e9b79ece0999a9cea
|
7
|
+
data.tar.gz: 296efcd551ba89621e4bcb010ab5db084cd28f5d0f745caf215b4d18703c4a176e26972355794326576714b8c3d58033eb74d75f635b3850d717dc317c5ae239
|
data/README.md
CHANGED
@@ -6,6 +6,11 @@ This gem backport Redis adapter with connection failure recovery support from Ra
|
|
6
6
|
|
7
7
|
Works with Rails 5+.
|
8
8
|
|
9
|
+
<picture>
|
10
|
+
<source media="(prefers-color-scheme: dark)" srcset="/assets/fly-sponsored-landscape-dark.svg">
|
11
|
+
<img alt="Sponsored by Fly.io" src="./assets/fly-sponsored-landscape-light.svg" height="97" width="259">
|
12
|
+
</picture>
|
13
|
+
|
9
14
|
## Usage
|
10
15
|
|
11
16
|
Install the gem:
|
@@ -17,12 +17,16 @@ module ActionCableRedisBackport
|
|
17
17
|
|
18
18
|
@reconnect_attempt = 0
|
19
19
|
@reconnect_attempts = ::ActionCable.server.config.cable&.fetch("reconnect_attempts", 1)
|
20
|
-
@reconnect_attempts =
|
20
|
+
@reconnect_attempts = if @reconnect_attempts.is_a?(Integer)
|
21
|
+
reconnect_delay = ::ActionCable.server.config.cable["reconnect_delay"] || 0
|
22
|
+
reconnect_delay_max = ::ActionCable.server.config.cable["reconnect_delay_max"] || 0.5
|
23
|
+
@reconnect_attempts.times.map { |i| [(reconnect_delay * 2**i), reconnect_delay_max].min }
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
27
|
private
|
24
28
|
if ::Redis::VERSION < "5"
|
25
|
-
ConnectionError = ::Redis::
|
29
|
+
ConnectionError = ::Redis::BaseConnectionError
|
26
30
|
else
|
27
31
|
ConnectionError = RedisClient::ConnectionError
|
28
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action-cable-redis-backport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actioncable
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
|
-
rubygems_version: 3.
|
95
|
+
rubygems_version: 3.4.8
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Backports Action Cable 7.1 Redis adapter for older versions
|