1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Call reconnect() when a ping doesnt arrive in expected time

This commit is contained in:
Pratik Naik 2015-02-26 16:33:41 -06:00
parent 89f3fb71c7
commit 6451fe1408

View file

@ -117,7 +117,7 @@ class @Cable
pingReceived: (timestamp) =>
if @lastPingTime? and (timestamp - @lastPingTime) > @PING_STALE_INTERVAL
console.log "Websocket connection is stale. Reconnecting.."
@connection?.close()
@reconnect()
else
@startWaitingForPing()
@lastPingTime = timestamp