diff options
Diffstat (limited to 'lib/assets')
-rw-r--r-- | lib/assets/javascripts/cable/connection_monitor.js.coffee | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/assets/javascripts/cable/connection_monitor.js.coffee b/lib/assets/javascripts/cable/connection_monitor.js.coffee index c6949971fb..30ce11957c 100644 --- a/lib/assets/javascripts/cable/connection_monitor.js.coffee +++ b/lib/assets/javascripts/cable/connection_monitor.js.coffee @@ -20,8 +20,7 @@ class Cable.ConnectionMonitor @pingedAt = now() disconnected: -> - if @reconnectAttempts is 0 - @reconnectAttempts += 1 + if @reconnectAttempts++ is 0 setTimeout => @consumer.connection.open() unless @consumer.connection.isOpen() , 200 @@ -57,7 +56,7 @@ class Cable.ConnectionMonitor reconnectIfStale: -> if @connectionIsStale() - @reconnectAttempts += 1 + @reconnectAttempts++ @consumer.connection.reopen() connectionIsStale: -> |