action-cable-redis-backport 1.0.1 → 1.0.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: 6f77f691e2f664673ae0982c4f2a7cff46ccfe154eaaea5892d376913cec8317
4
- data.tar.gz: dc14ed703796eeaaab9bbda3574d23919329c7ebb542625c1fcfb79d371f528b
3
+ metadata.gz: 21ba9cf50ede2f8bdac15cc9771ab72c6b0af7507103dd28b7569cf08c438a88
4
+ data.tar.gz: ca4428362708d50d2b53bcdb5d8939ed5e64b40b45f26409c7d8a388420435aa
5
5
  SHA512:
6
- metadata.gz: 570627389dda199cc59aa887d05988f8f67ee01e5f782e7fadc84569b3c7e2e892250405a511a44c68f611c8e61e88d282bdf9e34b57395c538074f028f96e7e
7
- data.tar.gz: 01ccc0a75edfd2edd2c57dd2a5af612b9bd0db5bf05e087a8bec4ac542f1f8a86f45ffb3a6de6e082008ba91b5e7a436a3aab6ca9460abf8ecb1b4749e03df44
6
+ metadata.gz: 0176a2c994aed186fed59e2d59f42c6b0e859171a43fc13d98e3e5048c979e172686ad2c7ca5f66b5282c687a0998821fe0ab075c212651e9b79ece0999a9cea
7
+ data.tar.gz: 296efcd551ba89621e4bcb010ab5db084cd28f5d0f745caf215b4d18703c4a176e26972355794326576714b8c3d58033eb74d75f635b3850d717dc317c5ae239
@@ -17,7 +17,11 @@ module ActionCableRedisBackport
17
17
 
18
18
  @reconnect_attempt = 0
19
19
  @reconnect_attempts = ::ActionCable.server.config.cable&.fetch("reconnect_attempts", 1)
20
- @reconnect_attempts = Array.new(@reconnect_attempts, 0) if @reconnect_attempts.is_a?(Integer)
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
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.1
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: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actioncable