Skip to content

Commit

Permalink
Immediately reconnect after first disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
javan committed Aug 28, 2015
1 parent ddfd649 commit f4b5a4e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/assets/javascripts/cable/connection_monitor.js.coffee
Expand Up @@ -19,6 +19,13 @@ class Cable.ConnectionMonitor
@reset()
@pingedAt = now()

disconnected: ->
if @reconnectAttempts is 0
@reconnectAttempts += 1
setTimeout =>
@consumer.connection.open()
, 200

received: ->
@pingedAt = now()

Expand Down

0 comments on commit f4b5a4e

Please sign in to comment.