aboutsummaryrefslogtreecommitdiffstats
path: root/lib/assets/javascripts/cable.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'lib/assets/javascripts/cable.js.coffee')
-rw-r--r--lib/assets/javascripts/cable.js.coffee11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/assets/javascripts/cable.js.coffee b/lib/assets/javascripts/cable.js.coffee
index 2b34c1b447..07f6ba2284 100644
--- a/lib/assets/javascripts/cable.js.coffee
+++ b/lib/assets/javascripts/cable.js.coffee
@@ -2,7 +2,6 @@
#= require_tree .
class @Cable
- MAX_CONNECTION_ATTEMPTS: 10
MAX_CONNECTION_INTERVAL: 5 * 1000
PING_STALE_INTERVAL: 6
@@ -53,11 +52,8 @@ class @Cable
@disconnected()
setTimeout =>
- if @isMaxConnectionAttemptsReached()
- @giveUp()
- else
- @incrementConnectionAttemptsCount()
- @connect()
+ @incrementConnectionAttemptsCount()
+ @connect()
, @generateReconnectInterval()
resetConnectionAttemptsCount: =>
@@ -66,9 +62,6 @@ class @Cable
incrementConnectionAttemptsCount: =>
@connectionAttempts += 1
- isMaxConnectionAttemptsReached: =>
- @connectionAttempts > @MAX_CONNECTION_ATTEMPTS
-
generateReconnectInterval: () ->
interval = (Math.pow(2, @connectionAttempts) - 1) * 1000
if interval > @MAX_CONNECTION_INTERVAL then @MAX_CONNECTION_INTERVAL else interval