diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2015-10-08 16:58:20 -0500 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2015-10-08 16:58:23 -0500 |
commit | 9ad20352e94f493be9a70e310104fb9932a2af2c (patch) | |
tree | 97b3b0beb7dc56e92a903d6115e4d51aad7d8e1e | |
parent | 935d0450c038b6c51d31c29ab2ce449848cfd7dc (diff) | |
download | rails-9ad20352e94f493be9a70e310104fb9932a2af2c.tar.gz rails-9ad20352e94f493be9a70e310104fb9932a2af2c.tar.bz2 rails-9ad20352e94f493be9a70e310104fb9932a2af2c.zip |
Be sure to initialize @heartbeat_timer. Third time is a charm!
-rw-r--r-- | lib/action_cable/server/connections.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/action_cable/server/connections.rb b/lib/action_cable/server/connections.rb index 4a5e21f5fd..b3d1632cf7 100644 --- a/lib/action_cable/server/connections.rb +++ b/lib/action_cable/server/connections.rb @@ -22,8 +22,8 @@ module ActionCable # then can't rely on being able to receive and send to it. So there's a 3 second heartbeat running on all connections. If the beat fails, we automatically # disconnect. def setup_heartbeat_timer - @heartbeat_timer ||= EM.next_tick do - EventMachine.add_periodic_timer(BEAT_INTERVAL) do + EM.next_tick do + @heartbeat_timer ||= EventMachine.add_periodic_timer(BEAT_INTERVAL) do EM.next_tick { connections.map &:beat } end end |