diff options
author | Javan Makhmali <javan@javan.us> | 2015-08-31 08:14:17 -0500 |
---|---|---|
committer | Javan Makhmali <javan@javan.us> | 2015-08-31 08:14:17 -0500 |
commit | 60adbaf4af97dc4aa9cd3a96058e0c94f642e911 (patch) | |
tree | 349ceb6d0c96e25a58d50e4b4d1eb92e4491c1b3 | |
parent | 9e0c0afe1c4e8d1fb831de82049ff94c23b22924 (diff) | |
download | rails-60adbaf4af97dc4aa9cd3a96058e0c94f642e911.tar.gz rails-60adbaf4af97dc4aa9cd3a96058e0c94f642e911.tar.bz2 rails-60adbaf4af97dc4aa9cd3a96058e0c94f642e911.zip |
Increment style
-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: -> |